mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 01:40:53 +07:00
ALSA: hda: fix possible null dereference
we are dereferencing pcm first then checking pcm. instead now lets put them in same if condition so that pcm is checked first. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
382fd7becc
commit
751e221689
@ -3230,9 +3230,8 @@ static int add_std_chmaps(struct hda_codec *codec)
|
|||||||
struct snd_pcm_chmap *chmap;
|
struct snd_pcm_chmap *chmap;
|
||||||
const struct snd_pcm_chmap_elem *elem;
|
const struct snd_pcm_chmap_elem *elem;
|
||||||
|
|
||||||
if (pcm->own_chmap)
|
if (!pcm || pcm->own_chmap ||
|
||||||
continue;
|
!hinfo->substreams)
|
||||||
if (!pcm || !hinfo->substreams)
|
|
||||||
continue;
|
continue;
|
||||||
elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;
|
elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;
|
||||||
err = snd_pcm_add_chmap_ctls(pcm->pcm, str, elem,
|
err = snd_pcm_add_chmap_ctls(pcm->pcm, str, elem,
|
||||||
|
Loading…
Reference in New Issue
Block a user