summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-05 09:05:46 +0300
committerKent Overstreet <kmo@daterainc.com>2013-07-12 00:22:46 -0700
commitd2a65ce2ac224413b291307201c5dafb03aa90d7 (patch)
tree398b6ca67bada221c6f56dc0adec950f63fbc0d8 /drivers/md
parent6aa8f1a6ca41c49721d2de4e048d3da8d06411f9 (diff)
downloadlinux-d2a65ce2ac224413b291307201c5dafb03aa90d7.tar.gz
linux-d2a65ce2ac224413b291307201c5dafb03aa90d7.tar.bz2
linux-d2a65ce2ac224413b291307201c5dafb03aa90d7.zip
bcache: check for allocation failures
There is a missing NULL check after the kzalloc(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bcache/sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index dd3f00a42729..12a2c2846f99 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -232,6 +232,8 @@ STORE(__cached_dev)
bch_uuid_write(dc->disk.c);
}
env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL);
+ if (!env)
+ return -ENOMEM;
add_uevent_var(env, "DRIVER=bcache");
add_uevent_var(env, "CACHED_UUID=%pU", dc->sb.uuid),
add_uevent_var(env, "CACHED_LABEL=%s", buf);