提交 ed0739b5 编写于 作者: L Libin Yang 提交者: Takashi Iwai

ALSA - hda: hdmi check NULL pointer in hdmi_set_chmap

Make sure per_pin is not NULL before using it.

Fixes: 9b3dc8aa ('ALSA: hda - Register chmap obj as priv data instead of codec')
Signed-off-by: NLibin Yang <libin.yang@linux.intel.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 50fd4987
......@@ -1858,6 +1858,8 @@ static void hdmi_set_chmap(struct hdac_device *hdac, int pcm_idx,
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx);
if (!per_pin)
return;
mutex_lock(&per_pin->lock);
per_pin->chmap_set = true;
memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册