From: yanhai zhu Date: Wed, 12 Nov 2008 19:38:54 +0000 (-0500) Subject: Btrfs: Add a missing return pointer check X-Git-Tag: v2.6.29-rc1~27^2~9^2~55^2~13 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7cbd8a839118eede2393f0926b8e15027162bcd6;p=linux-2.6-omap-h63xx.git Btrfs: Add a missing return pointer check Add a missing kzalloc() return pointer check in add_missing_dev(). Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d6f1996de62..ecf0633ab8c 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, 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;