diff options
author | yanhai zhu <zhu.yanhai@gmail.com> | 2008-11-12 14:38:54 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-11-12 14:38:54 -0500 |
commit | 7cbd8a839118eede2393f0926b8e15027162bcd6 (patch) | |
tree | 82370fed427f1433edfe93342e3b70c724ba8a3b /fs/btrfs/volumes.c | |
parent | 0df49b911db2b22ea808b596070b1cc65c23d148 (diff) |
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>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d6f1996de629..ecf0633ab8cc 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2755,6 +2755,8 @@ static struct btrfs_device *add_missing_dev(struct btrfs_root *root, | |||
2755 | struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices; | 2755 | struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices; |
2756 | 2756 | ||
2757 | device = kzalloc(sizeof(*device), GFP_NOFS); | 2757 | device = kzalloc(sizeof(*device), GFP_NOFS); |
2758 | if (!device) | ||
2759 | return NULL; | ||
2758 | list_add(&device->dev_list, | 2760 | list_add(&device->dev_list, |
2759 | &fs_devices->devices); | 2761 | &fs_devices->devices); |
2760 | device->barriers = 1; | 2762 | device->barriers = 1; |