linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trilok Soni <quic_tsoni@quicinc.com>
To: Anjelique Melendez <quic_amelende@quicinc.com>,
	<dmitry.torokhov@gmail.com>
Cc: <linux-input@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <collinsd@codeaurora.org>,
	<bjorn.andersson@linaro.org>, <swboyd@chromium.org>,
	<skakit@codeaurora.org>
Subject: Re: [PATCH 3/3] input: misc: pm8941-pwrkey: avoid potential null pointer dereference
Date: Thu, 20 Jan 2022 14:18:01 -0800	[thread overview]
Message-ID: <88e7a6c5-c94e-0b65-173d-5f21109e216e@quicinc.com> (raw)
In-Reply-To: <20220120204132.17875-4-quic_amelende@quicinc.com>

On 1/20/2022 12:41 PM, Anjelique Melendez wrote:
> From: David Collins <collinsd@codeaurora.org>
> 
> Add a null check for the pwrkey->data pointer after it is assigned
> in pm8941_pwrkey_probe().  This avoids a potential null pointer
> dereference when pwrkey->data->has_pon_pbs is accessed later in
> the probe function.
> 
> Change-Id: I589c4851e544d79a1863fd110b32a0b45ac03caf
> Signed-off-by: David Collins <collinsd@codeaurora.org>
> Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
> ---
>   drivers/input/misc/pm8941-pwrkey.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c
> index 0ce00736e695..ac08ed025802 100644
> --- a/drivers/input/misc/pm8941-pwrkey.c
> +++ b/drivers/input/misc/pm8941-pwrkey.c
> @@ -263,6 +263,10 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev)
>   
>   	pwrkey->dev = &pdev->dev;
>   	pwrkey->data = of_device_get_match_data(&pdev->dev);
> +	if (!pwrkey->data) {
> +		dev_err(&pdev->dev, "match data not found\n");
> +		return -ENODEV;
> +	}
>   

I don't understand why this patch is 3rd in the series. Isn't it 
independent from the debounce time? If not, then why it is not fixed as 
part of the patch which adds this debounce time support?

---Trilok Soni

  reply	other threads:[~2022-01-20 22:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 20:41 [PATCH 0/3] Add support for pm8941-pwrkey.c Anjelique Melendez
2022-01-20 20:41 ` [PATCH 1/3] input: misc: pm8941-pwrkey: add software key press debouncing support Anjelique Melendez
2022-01-21  4:08   ` Stephen Boyd
2022-01-22  0:04     ` Anjelique Melendez
2022-01-24 19:33       ` Stephen Boyd
2022-01-25 19:24         ` Anjelique Melendez
2022-01-20 20:41 ` [PATCH 2/3] input: misc: pm8941-pwrkey: simulate missed key press events Anjelique Melendez
2022-01-20 20:41 ` [PATCH 3/3] input: misc: pm8941-pwrkey: avoid potential null pointer dereference Anjelique Melendez
2022-01-20 22:18   ` Trilok Soni [this message]
2022-01-21  0:15     ` Anjelique Melendez
2022-01-20 23:01   ` Bjorn Andersson
2022-01-21  0:25     ` Anjelique Melendez
2022-01-21  4:18       ` Stephen Boyd
2022-01-24 22:26         ` Bjorn Andersson
2022-01-25  1:55           ` Stephen Boyd
2022-01-25 18:37             ` Bjorn Andersson
2022-01-27 19:51               ` Anjelique Melendez
2022-01-21  3:51 ` [PATCH 0/3] Add support for pm8941-pwrkey.c Stephen Boyd
2022-01-22  0:04   ` Anjelique Melendez

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=88e7a6c5-c94e-0b65-173d-5f21109e216e@quicinc.com \
    --to=quic_tsoni@quicinc.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=collinsd@codeaurora.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_amelende@quicinc.com \
    --cc=skakit@codeaurora.org \
    --cc=swboyd@chromium.org \
    /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).