From: Pan Bian <bianpan2016@163.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Lee Jones <lee.jones@linaro.org>,
Ksenija Stanojevic <ksenija.stanojevic@gmail.com>,
Marek Vasut <marex@denx.de>,
Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Pan Bian <bianpan2016@163.com>
Subject: input: touchscreen: mxs-lradc: use correct error check
Date: Tue, 8 Aug 2017 21:00:37 +0800 [thread overview]
Message-ID: <1502197237-19251-1-git-send-email-bianpan2016@163.com> (raw)
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>
---
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
next reply other threads:[~2017-08-08 13:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 13:00 Pan Bian [this message]
2017-08-14 17:30 ` Dmitry Torokhov
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=1502197237-19251-1-git-send-email-bianpan2016@163.com \
--to=bianpan2016@163.com \
--cc=dan.carpenter@oracle.com \
--cc=dmitry.torokhov@gmail.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
all inboxes | Powered by JetHome®