Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: hda: fix possible NULL dereference

After a for-loop was replaced by list_for_each_entry, see
Commit bbbc7e8502c9 ("ALSA: hda - Allocate hda_pcm objects dynamically"),
Commit 751e2216899c ("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: Markus Osterhoff <linux-kernel@k-raum.org>
Cc: <stable@vger.kernel.org> #v4.1+
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Markus Osterhoff and committed by
Takashi Iwai
c7e69ae6 f6b28e4d

+1 -1
+1 -1
sound/pci/hda/hda_codec.c
··· 3172 3172 struct snd_pcm_chmap *chmap; 3173 3173 const struct snd_pcm_chmap_elem *elem; 3174 3174 3175 - if (!pcm || pcm->own_chmap || 3175 + if (!pcm || !pcm->pcm || pcm->own_chmap || 3176 3176 !hinfo->substreams) 3177 3177 continue; 3178 3178 elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;