linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Kangjie Lu <kjlu@umn.edu>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	linux-iio@vger.kernel.org, Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	pakki001@umn.edu, linux-kernel@vger.kernel.org,
	NXP Linux Team <linux-imx@nxp.com>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Hartmut Knaack <knaack.h@gmx.de>, Shawn Guo <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] iio: adc: fix a potential NULL pointer dereference
Date: Sat, 9 Mar 2019 18:32:07 +0000	[thread overview]
Message-ID: <20190309183207.42b68d90@archlinux> (raw)
In-Reply-To: <20190309045356.8892-1-kjlu@umn.edu>

On Fri,  8 Mar 2019 22:53:55 -0600
Kangjie Lu <kjlu@umn.edu> wrote:

> devm_iio_trigger_alloc may fail and return NULL. The fix returns
> ENOMEM when it fails.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Seems obviously correct to me.  As it's been there a 'while'
I'm not going to rush it in however. This can wait for the next
merge window.

Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/mxs-lradc-adc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
> index c627513d9f0f..5384472b6c4d 100644
> --- a/drivers/iio/adc/mxs-lradc-adc.c
> +++ b/drivers/iio/adc/mxs-lradc-adc.c
> @@ -465,6 +465,8 @@ static int mxs_lradc_adc_trigger_init(struct iio_dev *iio)
>  
>  	trig = devm_iio_trigger_alloc(&iio->dev, "%s-dev%i", iio->name,
>  				      iio->id);
> +	if (!trig)
> +		return -ENOMEM;
>  
>  	trig->dev.parent = adc->dev;
>  	iio_trigger_set_drvdata(trig, iio);


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2019-03-09 18:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-09  4:53 [PATCH] iio: adc: fix a potential NULL pointer dereference Kangjie Lu
2019-03-09 18:32 ` Jonathan Cameron [this message]

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=20190309183207.42b68d90@archlinux \
    --to=jic23@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kjlu@umn.edu \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=pmeerw@pmeerw.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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 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).