From: Jonathan Cameron <jic23@kernel.org>
To: Wei Yongjun <weiyj.lk@gmail.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Ksenija Stanojevic <ksenija.stanojevic@gmail.com>,
Lee Jones <lee.jones@linaro.org>, Marek Vasut <marex@denx.de>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-iio@vger.kernel.org
Subject: Re: [PATCH -next v3] iio: adc: mxs-lradc: Fix return value check in mxs_lradc_adc_probe()
Date: Sat, 3 Jun 2017 10:53:26 +0100 [thread overview]
Message-ID: <20170603105326.41e8c180@kernel.org> (raw)
In-Reply-To: <e7789db6-27f3-0da7-cacb-bdc2b98a5e02@kernel.org>
On Sun, 21 May 2017 13:12:37 +0100
Jonathan Cameron <jic23@kernel.org> wrote:
> On 16/05/17 16:26, Wei Yongjun wrote:
> > From: Wei Yongjun <weiyongjun1@huawei.com>
> >
> > In case of error, the function devm_ioremap() returns NULL pointer
> > not ERR_PTR(). The IS_ERR() test in the return value check should
> > be replaced with NULL test. Also add NULL test for iores.
> >
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Hi Wei,
>
> At the moment I haven't yet sent a pull request to Greg since the
> merge window closed. Up shot is that I don't have the current version
> of this code in my tree just yet. That should be sorted in the
> next week or so. Please remind me if it looks like I have forgotten
> this patch.
>
> Thanks,
>
> Jonathan
Applied to the fixes-togreg branch of iio.git.
Thanks,
Jonathan
> > ---
> > v2 -> v3: use NULL test instead of devm_ioremap_resource()
> > ---
> > drivers/iio/adc/mxs-lradc-adc.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
> > index b0c7d8e..6888167 100644
> > --- a/drivers/iio/adc/mxs-lradc-adc.c
> > +++ b/drivers/iio/adc/mxs-lradc-adc.c
> > @@ -718,9 +718,12 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
> > adc->dev = dev;
> >
> > iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > + if (!iores)
> > + return -EINVAL;
> > +
> > adc->base = devm_ioremap(dev, iores->start, resource_size(iores));
> > - if (IS_ERR(adc->base))
> > - return PTR_ERR(adc->base);
> > + if (!adc->base)
> > + return -ENOMEM;
> >
> > init_completion(&adc->completion);
> > spin_lock_init(&adc->lock);
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-06-03 9:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 3:36 [PATCH -next] iio: adc: mxs-lradc: Fix return value check in mxs_lradc_adc_probe() Wei Yongjun
2017-04-26 5:23 ` Jonathan Cameron
2017-04-26 8:49 ` Lee Jones
2017-04-26 8:58 ` weiyongjun (A)
2017-04-26 10:07 ` Lee Jones
2017-04-26 10:28 ` weiyongjun (A)
2017-04-26 15:02 ` Jonathan Cameron
2017-04-27 15:14 ` [PATCH -next v2] " Wei Yongjun
2017-04-30 16:31 ` Jonathan Cameron
2017-05-01 22:22 ` Ksenija Stanojević
2017-05-02 1:43 ` weiyongjun (A)
2017-05-16 15:26 ` [PATCH -next v3] " Wei Yongjun
2017-05-21 12:12 ` Jonathan Cameron
2017-06-03 9:53 ` 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=20170603105326.41e8c180@kernel.org \
--to=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=ksenija.stanojevic@gmail.com \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=marex@denx.de \
--cc=pmeerw@pmeerw.net \
--cc=weiyj.lk@gmail.com \
--cc=weiyongjun1@huawei.com \
/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.