From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: gabriel.fernandez@st.com
Cc: linux-clk@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
giuseppe.condorelli@st.com,
Nate Drude <nate.drude@ohmlinxelectronics.com>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH v1] Input: st-keyscan - fix potential zalloc NULL dereference
Date: Sat, 16 Feb 2019 21:26:34 -0800 [thread overview]
Message-ID: <20190217052634.GA107793@dtor-ws> (raw)
In-Reply-To: <20190212153055.3925-1-gabriel.fernandez@st.com>
On Tue, Feb 12, 2019 at 04:30:55PM +0100, gabriel.fernandez@st.com wrote:
> From: Gabriel Fernandez <gabriel.fernandez@st.com>
>
> This patch fixes the following static checker warning:
>
> drivers/input/keyboard/st-keyscan.c:156 keyscan_probe()
> error: potential zalloc NULL dereference: 'keypad_data->input_dev'
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Applied, thank you.
> ---
> drivers/input/keyboard/st-keyscan.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
> index babcfb165e4f..3b85631fde91 100644
> --- a/drivers/input/keyboard/st-keyscan.c
> +++ b/drivers/input/keyboard/st-keyscan.c
> @@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev)
>
> input_dev->id.bustype = BUS_HOST;
>
> + keypad_data->input_dev = input_dev;
> +
> error = keypad_matrix_key_parse_dt(keypad_data);
> if (error)
> return error;
> @@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev)
>
> input_set_drvdata(input_dev, keypad_data);
>
> - keypad_data->input_dev = input_dev;
> -
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> keypad_data->base = devm_ioremap_resource(&pdev->dev, res);
> if (IS_ERR(keypad_data->base))
> --
> 2.17.0
>
--
Dmitry
prev parent reply other threads:[~2019-02-17 5:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 15:30 [PATCH v1] Input: st-keyscan - fix potential zalloc NULL dereference gabriel.fernandez
2019-02-17 5: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=20190217052634.GA107793@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=gabriel.fernandez@st.com \
--cc=giuseppe.condorelli@st.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=nate.drude@ohmlinxelectronics.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).