btrfs: tests: handle fs_info allocation failure in extent_io tests
authorDavid Sterba <dsterba@suse.com>
Fri, 15 Mar 2019 15:43:11 +0000 (16:43 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:24 +0000 (19:02 +0200)
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tests/extent-io-tests.c

index e46ed2985b19aed5183868c9ba2f910051c9d143..74f69df7a7e1942855098c9d8cdc382790f1c094 100644 (file)
@@ -392,6 +392,10 @@ static int test_eb_bitmaps(u32 sectorsize, u32 nodesize)
                ? sectorsize * 4 : sectorsize;
 
        fs_info = btrfs_alloc_dummy_fs_info(len, len);
+       if (!fs_info) {
+               test_err("could not allocate fs_info");
+               return -ENOMEM;
+       }
 
        bitmap = kmalloc(len, GFP_KERNEL);
        if (!bitmap) {