mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 14:50:53 +07:00
ALSA: hda: fix possible NULL dereference
After a for-loop was replaced by list_for_each_entry, see Commitbbbc7e8502
("ALSA: hda - Allocate hda_pcm objects dynamically"), Commit751e221689
("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>
This commit is contained in:
parent
f6b28e4ded
commit
c7e69ae6b4
@ -3172,7 +3172,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;
|
||||
|
Loading…
Reference in New Issue
Block a user