From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: marex@denx.de, ksenija.stanojevic@gmail.com,
linux-input@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: Re: [PATCH v2] input: touchscreen: mxs-lradc: Do a NULL check on iores
Date: Mon, 14 Aug 2017 10:26:54 -0700 [thread overview]
Message-ID: <20170814172654.GA15368@dtor-ws> (raw)
In-Reply-To: <1498099872-16959-1-git-send-email-festevam@gmail.com>
On Wed, Jun 21, 2017 at 11:51:12PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> platform_get_resource() may fail, so we should better do a NULL check
> and return error on failure.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Applied, thank you.
> ---
> Changes since v1:
> - Instead of using devm_ioremap_resource, do a NULL check on iores
>
> drivers/input/touchscreen/mxs-lradc-ts.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
> index 58c016c..71bf493 100644
> --- a/drivers/input/touchscreen/mxs-lradc-ts.c
> +++ b/drivers/input/touchscreen/mxs-lradc-ts.c
> @@ -630,6 +630,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
> spin_lock_init(&ts->lock);
>
> iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!iores)
> + return -EINVAL;
> ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
> if (IS_ERR(ts->base))
> return PTR_ERR(ts->base);
> --
> 2.7.4
>
--
Dmitry
prev parent reply other threads:[~2017-08-14 17:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 2:51 [PATCH v2] input: touchscreen: mxs-lradc: Do a NULL check on iores Fabio Estevam
2017-08-14 17:26 ` Dmitry Torokhov [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=20170814172654.GA15368@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=festevam@gmail.com \
--cc=ksenija.stanojevic@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=marex@denx.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;
as well as URLs for NNTP newsgroup(s).