diff mbox series

[01/22] btrfs: tests: handle fs_info allocation failure in extent_io tests

Message ID e5c2d222e4d72e6435622752ef3c3335558ace82.1552927639.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series Self test cleanups, error handling fixes | expand

Commit Message

David Sterba March 18, 2019, 4:50 p.m. UTC
Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/tests/extent-io-tests.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/tests/extent-io-tests.c b/fs/btrfs/tests/extent-io-tests.c
index 3c46d7f23456..c444243f3fdd 100644
--- a/fs/btrfs/tests/extent-io-tests.c
+++ b/fs/btrfs/tests/extent-io-tests.c
@@ -388,6 +388,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) {