Merge branch 'for-linus-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
[linux-2.6-block.git] / fs / btrfs / ctree.c
index 165e7ec12af7bf8c351a1f8bb0e98637f0f2df51..a3a75f1de002295c425f5957de7e9aba269a7682 100644 (file)
@@ -5392,13 +5392,10 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
                goto out;
        }
 
-       tmp_buf = kmalloc(fs_info->nodesize, GFP_KERNEL | __GFP_NOWARN);
+       tmp_buf = kvmalloc(fs_info->nodesize, GFP_KERNEL);
        if (!tmp_buf) {
-               tmp_buf = vmalloc(fs_info->nodesize);
-               if (!tmp_buf) {
-                       ret = -ENOMEM;
-                       goto out;
-               }
+               ret = -ENOMEM;
+               goto out;
        }
 
        left_path->search_commit_root = 1;