bcache: check for allocation failures
Subsystems (3)
PATCH 1/1 bcache: check for allocation failures
There is a missing NULL check after the kzalloc().
Signed-off-by Dan Carpenter <[email protected]>
drivers/md/bcache/sysfs.c +2 -0
@@ -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¼ache" );add_uevent_var (env,"CACHED_UUID=%pU" , dc->sb.uuid),add_uevent_var (env,"CACHED_LABEL=%s" , buf);
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Dan Carpenter
There is a missing NULL check after the
kzalloc().Signed-off-by Dan Carpenter <[email protected]>drivers/md/bcache/sysfs.c +0
-0
drivers/md/bcache/sysfs.c STORE(__cached_dev) · line 239
Quoted 8 lines
drivers/md/bcache/sysfs.c +2
-0@@ -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¼ache" );add_uevent_var (env,"CACHED_UUID=%pU" , dc->sb.uuid),add_uevent_var (env,"CACHED_LABEL=%s" , buf);
Thanks - applied
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html