]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Btrfs: Add a missing return pointer check
authoryanhai zhu <zhu.yanhai@gmail.com>
Wed, 12 Nov 2008 19:38:54 +0000 (14:38 -0500)
committerChris Mason <chris.mason@oracle.com>
Wed, 12 Nov 2008 19:38:54 +0000 (14:38 -0500)
Add a missing kzalloc() return pointer check in add_missing_dev().

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/volumes.c

index d6f1996de629d419c54def5c7d54c2011f170004..ecf0633ab8cc9093cb6e48beb034dfc1274c5a24 100644 (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;