linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Pan Bian <bianpan2016@163.com>
Cc: Lee Jones <lee.jones@linaro.org>,
	Ksenija Stanojevic <ksenija.stanojevic@gmail.com>,
	Marek Vasut <marex@denx.de>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: input: touchscreen: mxs-lradc: use correct error check
Date: Mon, 14 Aug 2017 10:30:02 -0700	[thread overview]
Message-ID: <20170814173002.GB15368@dtor-ws> (raw)
In-Reply-To: <1502197237-19251-1-git-send-email-bianpan2016@163.com>

On Tue, Aug 08, 2017 at 09:00:37PM +0800, Pan Bian wrote:
> Function devm_ioremap() will return a NULL pointer on failure. However,
> in function mxs_lradc_ts_probe(), its return value is checked with
> IS_ERR(), which cannot detect the exceptional case.
> 
> Signed-off-by: Pan Bian <bianpan2016@163.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/mxs-lradc-ts.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/mxs-lradc-ts.c b/drivers/input/touchscreen/mxs-lradc-ts.c
> index 58c016c..9bcc98c6 100644
> --- a/drivers/input/touchscreen/mxs-lradc-ts.c
> +++ b/drivers/input/touchscreen/mxs-lradc-ts.c
> @@ -631,8 +631,8 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
> -	if (IS_ERR(ts->base))
> -		return PTR_ERR(ts->base);
> +	if (!ts->base)
> +		return -ENOMEM;
>  
>  	ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
>  				   &ts_wires);
> -- 
> 1.9.1
> 
> 

-- 
Dmitry

      reply	other threads:[~2017-08-14 17:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 13:00 input: touchscreen: mxs-lradc: use correct error check Pan Bian
2017-08-14 17:30 ` 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=20170814173002.GB15368@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=bianpan2016@163.com \
    --cc=dan.carpenter@oracle.com \
    --cc=ksenija.stanojevic@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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).