Skip to content

Commit

Permalink
bcache: check for allocation failures
Browse files Browse the repository at this point in the history
There is a missing NULL check after the kzalloc().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
  • Loading branch information
Dan Carpenter authored and Kent Overstreet committed Jul 12, 2013
1 parent 6aa8f1a commit d2a65ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/md/bcache/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d2a65ce

Please sign in to comment.