From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Shawn Guo <shawnguo@kernel.org>, linux-input@vger.kernel.org
Subject: Re: [PATCH] input: snvs_pwrkey: fix returned value check of syscon_regmap_lookup_by_phandle()
Date: Tue, 8 Mar 2016 11:06:59 -0800 [thread overview]
Message-ID: <20160308190659.GC24317@dtor-ws> (raw)
In-Reply-To: <1457455864-32077-1-git-send-email-vz@mleia.com>
On Tue, Mar 08, 2016 at 06:51:04PM +0200, Vladimir Zapolskiy wrote:
> On error syscon_regmap_lookup_by_phandle() returns ERR_PTR() value,
> which makes a check for NULL invalid and may lead to oops on error
> path.
>
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Applied, thank you.
> ---
> drivers/input/keyboard/snvs_pwrkey.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> index 9adf13a..9e92206 100644
> --- a/drivers/input/keyboard/snvs_pwrkey.c
> +++ b/drivers/input/keyboard/snvs_pwrkey.c
> @@ -111,9 +111,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap");
> - if (!pdata->snvs) {
> + if (IS_ERR(pdata->snvs)) {
> dev_err(&pdev->dev, "Can't get snvs syscon\n");
> - return -ENODEV;
> + return PTR_ERR(pdata->snvs);
> }
>
> if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) {
> --
> 2.1.4
>
--
Dmitry
prev parent reply other threads:[~2016-03-08 19:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-08 16:51 [PATCH] input: snvs_pwrkey: fix returned value check of syscon_regmap_lookup_by_phandle() Vladimir Zapolskiy
2016-03-08 19:06 ` 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=20160308190659.GC24317@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=shawnguo@kernel.org \
--cc=vz@mleia.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 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).