Commit d2a65ce2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kent Overstreet

bcache: check for allocation failures

There is a missing NULL check after the kzalloc().
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
parent 6aa8f1a6
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment