Skip to content

Commit

Permalink
ALSA: hda: Avoid NULL pointer dereference at snd_hdac_stream_start()
Browse files Browse the repository at this point in the history
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.

Fixes: 9b6f7e7 ("ALSA: hda: program stripe bits for controller")
Signed-off-by: Mariusz Ceier <mceier+kernel@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Mariusz Ceier authored and Takashi Iwai committed Mar 13, 2019
1 parent a634090 commit d344e07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/hda/hdac_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit d344e07

Please sign in to comment.