From: Darren Hart <dvhart@infradead.org>
To: Jonathan Woithe <jwoithe@just42.net>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
Andy Shevchenko <andy@infradead.org>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: fujitsu-laptop: add NULL check on devm_kzalloc() return value
Date: Fri, 7 Jul 2017 10:02:08 -0700 [thread overview]
Message-ID: <20170707170208.GB30284@fury> (raw)
In-Reply-To: <20170707001900.GE6573@marvin.atrad.com.au>
On Fri, Jul 07, 2017 at 09:49:00AM +0930, Jonathan Woithe wrote:
> On Thu, Jul 06, 2017 at 05:19:02PM -0500, Gustavo A. R. Silva wrote:
> > Check return value from call to devm_kzalloc()
> > in order to prevent a NULL pointer dereference.
> >
> > This issue was detected using Coccinelle and the following semantic patch:
> >
> > @@
> > expression x;
> > identifier fld;
> > @@
> >
> > * x = devm_kzalloc(...);
> > ... when != x == NULL
> > x->fld
> >
> > Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>
> These checks should be added in the interest of code correctness.
> devm_kzalloc() can fail (even if it's extremely unlikely in practice) so we
> should check for this.
>
> Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Thanks Gustavo and Jonathan,
Queued to testing.
--
Darren Hart
VMware Open Source Technology Center
next prev parent reply other threads:[~2017-07-07 17:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 22:19 [PATCH] platform/x86: fujitsu-laptop: add NULL check on devm_kzalloc() return value Gustavo A. R. Silva
2017-07-07 0:19 ` Jonathan Woithe
2017-07-07 17:02 ` Darren Hart [this message]
2017-07-10 19:37 ` Gustavo A. R. Silva
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=20170707170208.GB30284@fury \
--to=dvhart@infradead.org \
--cc=andy@infradead.org \
--cc=garsilva@embeddedor.com \
--cc=jwoithe@just42.net \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.