From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alasdair Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com, Neil Brown <neilb@suse.de>,
linux-raid@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] dm thin: check kmalloc in dm_deferred_set_create()
Date: Tue, 02 Oct 2012 11:46:49 +0000 [thread overview]
Message-ID: <20121002114649.GA1413@elgon.mountain> (raw)
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;
next reply other threads:[~2012-10-02 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-02 11:46 Dan Carpenter [this message]
2012-10-02 12:58 ` [dm-devel] [patch] dm thin: check kmalloc in dm_deferred_set_create() Alasdair G Kergon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121002114649.GA1413@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox