Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d344e079 authored by Mariusz Ceier's avatar Mariusz Ceier Committed by Takashi Iwai
Browse files

ALSA: hda: Avoid NULL pointer dereference at snd_hdac_stream_start()



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: 9b6f7e7a ("ALSA: hda: program stripe bits for controller")
Signed-off-by: default avatarMariusz Ceier <mceier+kernel@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a634090a
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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,
			      1 << azx_dev->index);
			      1 << azx_dev->index);
	/* set stripe control */
	/* set stripe control */
	if (azx_dev->substream)
		stripe_ctl = snd_hdac_get_stream_stripe_ctl(bus, 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,
	snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK,
				stripe_ctl);
				stripe_ctl);
	/* set DMA start and interrupt mask */
	/* set DMA start and interrupt mask */