public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>,
	lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH] ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_free_kcontrol
Date: Fri, 22 Mar 2019 09:43:39 -0500	[thread overview]
Message-ID: <44b4ca5a-c76b-e2ae-0f57-294198a37b25@linux.intel.com> (raw)
In-Reply-To: <1553257809-9294-1-git-send-email-pankaj.laxminarayan.bharadiya@intel.com>

On 3/22/19 7:30 AM, Pankaj Bharadiya wrote:
> w_text_param can be NULL and it is being dereferenced without checking.
> Add the missing sanity check to prevent  NULL pointer dereference.
> 
> Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
> ---
>   sound/soc/soc-dapm.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index 1ec06ef..67b032c 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -3957,6 +3957,10 @@ snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
>   	int count;
>   
>   	devm_kfree(card->dev, (void *)*private_value);
> +
> +	if (!w_param_text)
> +		return;

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

next time, try using git format-patch -v2 to signal it's an updated 
version, it helps reviewers. Thanks!

> +
>   	for (count = 0 ; count < num_params; count++)
>   		devm_kfree(card->dev, (void *)w_param_text[count]);
>   	devm_kfree(card->dev, w_param_text);
> 


  reply	other threads:[~2019-03-22 14:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 12:30 [PATCH] ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_free_kcontrol Pankaj Bharadiya
2019-03-22 14:43 ` Pierre-Louis Bossart [this message]
2019-03-25 12:22 ` Applied "ASoC: dapm: Fix NULL pointer dereference in snd_soc_dapm_free_kcontrol" to the asoc tree Mark Brown

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=44b4ca5a-c76b-e2ae-0f57-294198a37b25@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pankaj.laxminarayan.bharadiya@intel.com \
    --cc=perex@perex.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox