提交 d2a65ce2 编写于 作者: D Dan Carpenter 提交者: Kent Overstreet

bcache: check for allocation failures

There is a missing NULL check after the kzalloc().
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册