Commit 7cbd8a83 authored by yanhai zhu's avatar yanhai zhu Committed by Chris Mason

Btrfs: Add a missing return pointer check

Add a missing kzalloc() return pointer check in add_missing_dev().
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 0df49b91
...@@ -2755,6 +2755,8 @@ static struct btrfs_device *add_missing_dev(struct btrfs_root *root, ...@@ -2755,6 +2755,8 @@ static struct btrfs_device *add_missing_dev(struct btrfs_root *root,
struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices; struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices;
device = kzalloc(sizeof(*device), GFP_NOFS); device = kzalloc(sizeof(*device), GFP_NOFS);
if (!device)
return NULL;
list_add(&device->dev_list, list_add(&device->dev_list,
&fs_devices->devices); &fs_devices->devices);
device->barriers = 1; device->barriers = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment