Commit 360c2a14 authored by Markus Osterhoff's avatar Markus Osterhoff Committed by Greg Kroah-Hartman

ALSA: hda: fix possible NULL dereference

commit c7e69ae6 upstream.

After a for-loop was replaced by list_for_each_entry, see
Commit bbbc7e85 ("ALSA: hda - Allocate hda_pcm objects dynamically"),
Commit 751e2216 ("ALSA: hda: fix possible null dereference"),
a possible NULL pointer dereference has been introduced; this patch adds
the NULL check on pcm->pcm, while leaving a potentially superfluous
check on pcm itself untouched.
Signed-off-by: default avatarMarkus Osterhoff <linux-kernel@k-raum.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ac44e50e
......@@ -3259,7 +3259,7 @@ static int add_std_chmaps(struct hda_codec *codec)
struct snd_pcm_chmap *chmap;
const struct snd_pcm_chmap_elem *elem;
if (!pcm || pcm->own_chmap ||
if (!pcm || !pcm->pcm || pcm->own_chmap ||
!hinfo->substreams)
continue;
elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment