linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -next] bcache: check for allocation failures
@ 2013-07-05  6:05 Dan Carpenter
       [not found] ` <20130705060307.GB14443-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-07-05  6:05 UTC (permalink / raw)
  To: Kent Overstreet, Gabriel de Perthuis
  Cc: Neil Brown, linux-bcache-u79uwXL29TY76Z2rM5mHXA,
	linux-raid-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

There is a missing NULL check after the kzalloc().

Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 48f0353..4fe6ab2 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch -next] bcache: check for allocation failures
       [not found] ` <20130705060307.GB14443-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
@ 2013-07-11  1:48   ` Kent Overstreet
  0 siblings, 0 replies; 2+ messages in thread
From: Kent Overstreet @ 2013-07-11  1:48 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Gabriel de Perthuis, Neil Brown,
	linux-bcache-u79uwXL29TY76Z2rM5mHXA,
	linux-raid-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On Fri, Jul 05, 2013 at 09:05:46AM +0300, Dan Carpenter wrote:
> There is a missing NULL check after the kzalloc().
> 
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
> index 48f0353..4fe6ab2 100644
> --- a/drivers/md/bcache/sysfs.c
> +++ b/drivers/md/bcache/sysfs.c
> @@ -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);

Thanks - applied

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-11  1:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-05  6:05 [patch -next] bcache: check for allocation failures Dan Carpenter
     [not found] ` <20130705060307.GB14443-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2013-07-11  1:48   ` Kent Overstreet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).