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>
This commit is contained in:
yanhai zhu 2008-11-12 14:38:54 -05:00 committed by Chris Mason
parent 0df49b911d
commit 7cbd8a8391
1 changed files with 2 additions and 0 deletions

View File

@ -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;
device = kzalloc(sizeof(*device), GFP_NOFS);
if (!device)
return NULL;
list_add(&device->dev_list,
&fs_devices->devices);
device->barriers = 1;