Btrfs: Add a missing return pointer check
Add a missing kzalloc() return pointer check in add_missing_dev().
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d6f1996..ecf0633 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2755,6 +2755,8 @@
struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices;
device = kzalloc(sizeof(*device), GFP_NOFS);
+ if (!device)
+ return NULL;
list_add(&device->dev_list,
&fs_devices->devices);
device->barriers = 1;