linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] dm thin: check kmalloc in dm_deferred_set_create()
@ 2012-10-02 11:46 Dan Carpenter
  2012-10-02 12:58 ` [dm-devel] " Alasdair G Kergon
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-10-02 11:46 UTC (permalink / raw)
  To: Alasdair Kergon; +Cc: dm-devel, Neil Brown, linux-raid, kernel-janitors

We can simply return NULL here.  The callers already handle that.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index da0d5d1..fa7d21e 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -394,6 +394,8 @@ static struct dm_deferred_set *dm_deferred_set_create(void)
 	struct dm_deferred_set *ds;
 
 	ds = kmalloc(sizeof(*ds), GFP_KERNEL);
+	if (!ds)
+		return NULL;
 
 	spin_lock_init(&ds->lock);
 	ds->current_entry = 0;

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

* Re: [dm-devel] [patch] dm thin: check kmalloc in dm_deferred_set_create()
  2012-10-02 11:46 [patch] dm thin: check kmalloc in dm_deferred_set_create() Dan Carpenter
@ 2012-10-02 12:58 ` Alasdair G Kergon
  0 siblings, 0 replies; 2+ messages in thread
From: Alasdair G Kergon @ 2012-10-02 12:58 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-raid, dm-devel, kernel-janitors, Mike Snitzer

On Tue, Oct 02, 2012 at 02:46:49PM +0300, Dan Carpenter wrote:
> We can simply return NULL here.  The callers already handle that.
 
Folded into dm-thin-prepare-to-separate-bio_prison-code.patch in
linux-next, thanks.

Alasdair


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

end of thread, other threads:[~2012-10-02 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 11:46 [patch] dm thin: check kmalloc in dm_deferred_set_create() Dan Carpenter
2012-10-02 12:58 ` [dm-devel] " Alasdair G Kergon

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).