All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aditya Pakki <pakki001@umn.edu>
To: Aditya Pakki <pakki001@umn.edu>
Cc: Barry Song <baohua@kernel.org>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Kangjie Lu <kjlu@umn.edu>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ASoC: codecs: Fix to avoid potential NULL pointer dereferences
Date: Mon, 18 Mar 2019 20:03:56 -0500	[thread overview]
Message-ID: <CA+EnHHTAKMafHG8cspAipzKfH3F3EX8oXaMkZyEfAD1ByQB6Gw@mail.gmail.com> (raw)
In-Reply-To: <20190319005805.13823-1-pakki001@umn.edu>

Apologies for the incorrect patch.
"match" is dead code and I will send a correct patch again.




On Mon, Mar 18, 2019 at 7:58 PM Aditya Pakki <pakki001@umn.edu> wrote:

> In sirf_audio_codec_driver_probe, of_match_node may fail and return a
> NULL pointer. The patch avoids a potential NULL pointer dereference.
>
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>  sound/soc/codecs/sirf-audio-codec.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/codecs/sirf-audio-codec.c
> b/sound/soc/codecs/sirf-audio-codec.c
> index e424499a8450..fd2bbd6a3c58 100644
> --- a/sound/soc/codecs/sirf-audio-codec.c
> +++ b/sound/soc/codecs/sirf-audio-codec.c
> @@ -464,6 +464,8 @@ static int sirf_audio_codec_driver_probe(struct
> platform_device *pdev)
>         const struct of_device_id *match;
>
>         match = of_match_node(sirf_audio_codec_of_match,
> pdev->dev.of_node);
> +       if (!match)
> +               return -ENXIO;
>
>         sirf_audio_codec = devm_kzalloc(&pdev->dev,
>                 sizeof(struct sirf_audio_codec), GFP_KERNEL);
> --
> 2.17.1
>
>

  reply	other threads:[~2019-03-19  1:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  0:58 [PATCH] ASoC: codecs: Fix to avoid potential NULL pointer dereferences Aditya Pakki
2019-03-19  0:58 ` Aditya Pakki
2019-03-19  1:03 ` Aditya Pakki [this message]
2019-03-22 16:47 ` Steven Price
2019-03-22 16:47   ` Steven Price

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=CA+EnHHTAKMafHG8cspAipzKfH3F3EX8oXaMkZyEfAD1ByQB6Gw@mail.gmail.com \
    --to=pakki001@umn.edu \
    --cc=alsa-devel@alsa-project.org \
    --cc=baohua@kernel.org \
    --cc=broonie@kernel.org \
    --cc=kjlu@umn.edu \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.