mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] slimbus: ngd: Fix to avoid potential NULL pointer dereference
Date: Wed, 20 Mar 2019 14:47:13 +0000	[thread overview]
Message-ID: <9508fd1e-7083-4bb7-eaa4-6986ef097d0d@linaro.org> (raw)
In-Reply-To: <20190319012523.14644-1-pakki001@umn.edu>



On 19/03/2019 01:25, Aditya Pakki wrote:
> In of_qcom_slim_ngd_register, of_match_node may fail and return a NULL
> pointer. This patch avoids such a scenario leading to NULL pointer
> dereference.
> 
> Fixes: 458a445deb9c ("slimbus: ngd: Fix build error on x86")
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>   drivers/slimbus/qcom-ngd-ctrl.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
> index 71f094c9ec68..9cc7256028c9 100644
> --- a/drivers/slimbus/qcom-ngd-ctrl.c
> +++ b/drivers/slimbus/qcom-ngd-ctrl.c
> @@ -1332,6 +1332,8 @@ static int of_qcom_slim_ngd_register(struct device *parent,
>   	u32 id;
>   
>   	match = of_match_node(qcom_slim_ngd_dt_match, parent->of_node);
> +	if (!match)
> +		return -ENXIO;

We would not even enter this path without matching compatible, so I 
think a check here is not really necessary.

thanks,
srini

      reply	other threads:[~2019-03-20 14:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  1:25 Aditya Pakki
2019-03-20 14:47 ` Srinivas Kandagatla [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=9508fd1e-7083-4bb7-eaa4-6986ef097d0d@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=kjlu@umn.edu \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /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

Powered by JetHome