提交 751e2216 编写于 作者: S Sudip Mukherjee 提交者: Takashi Iwai

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: NSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 382fd7be
......@@ -3230,9 +3230,8 @@ static int add_std_chmaps(struct hda_codec *codec)
struct snd_pcm_chmap *chmap;
const struct snd_pcm_chmap_elem *elem;
if (pcm->own_chmap)
continue;
if (!pcm || !hinfo->substreams)
if (!pcm || pcm->own_chmap ||
!hinfo->substreams)
continue;
elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;
err = snd_pcm_add_chmap_ctls(pcm->pcm, str, elem,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册