Skip to content

Commit

Permalink
Btrfs: Add a missing return pointer check
Browse files Browse the repository at this point in the history
Add a missing kzalloc() return pointer check in add_missing_dev().

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
yanhai zhu authored and Chris Mason committed Nov 12, 2008
1 parent 0df49b9 commit 7cbd8a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7cbd8a8

Please sign in to comment.