bcache: check for allocation failures
There is a missing NULL check after the kzalloc(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
This commit is contained in:
parent
6aa8f1a6ca
commit
d2a65ce2ac
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue