Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);