linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Mariusz Ceier" <mceier+kernel@gmail.com>
Cc: <alsa-devel@alsa-project.org>,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"Keyon Jie" <yang.jie@linux.intel.com>,
	"Mohan Kumar D" <mkumard@nvidia.com>,
	"Ravindra Lokhande" <rlokhande@nvidia.com>,
	"Sameer Pujar" <spujar@nvidia.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] sound/hda/hdac_stream: Avoid NULL pointer dereference
Date: Wed, 13 Mar 2019 11:24:33 +0100	[thread overview]
Message-ID: <s5htvg7ul5q.wl-tiwai@suse.de> (raw)
In-Reply-To: <20190311205357.7573-2-mceier+kernel@gmail.com>

On Mon, 11 Mar 2019 21:53:57 +0100,
Mariusz Ceier wrote:
> 
> For ca0132 codec, azx_dev->stream is NULL during firmware loading.
> Calling snd_hdac_get_stream_stripe_ctl unconditionally causes NULL
> pointer dereference in that function.
> 
> Signed-off-by: Mariusz Ceier <mceier+kernel@gmail.com>

Applied now (with a proper Fixes tag).


thanks,

Takashi


> ---
>  sound/hda/hdac_stream.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
> index f5dd288d1a7a..76e9b41fcea2 100644
> --- a/sound/hda/hdac_stream.c
> +++ b/sound/hda/hdac_stream.c
> @@ -95,7 +95,10 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start)
>  			      1 << azx_dev->index,
>  			      1 << azx_dev->index);
>  	/* set stripe control */
> -	stripe_ctl = snd_hdac_get_stream_stripe_ctl(bus, azx_dev->substream);
> +	if (azx_dev->substream)
> +		stripe_ctl = snd_hdac_get_stream_stripe_ctl(bus, azx_dev->substream);
> +	else
> +		stripe_ctl = 0;
>  	snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK,
>  				stripe_ctl);
>  	/* set DMA start and interrupt mask */
> -- 
> 2.21.0
> 
> 

      reply	other threads:[~2019-03-13 10:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 20:53 [PATCH 0/1] sound/hda/hdac_stream: Avoid NULL pointer dereference Mariusz Ceier
2019-03-11 20:53 ` [PATCH 1/1] " Mariusz Ceier
2019-03-13 10:24   ` Takashi Iwai [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=s5htvg7ul5q.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mceier+kernel@gmail.com \
    --cc=mkumard@nvidia.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rlokhande@nvidia.com \
    --cc=spujar@nvidia.com \
    --cc=yang.jie@linux.intel.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).