Commit ed0739b5 authored by Libin Yang's avatar Libin Yang Committed by 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: default avatarLibin Yang <libin.yang@linux.intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 50fd4987
...@@ -1858,6 +1858,8 @@ static void hdmi_set_chmap(struct hdac_device *hdac, int pcm_idx, ...@@ -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 *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx);
if (!per_pin)
return;
mutex_lock(&per_pin->lock); mutex_lock(&per_pin->lock);
per_pin->chmap_set = true; per_pin->chmap_set = true;
memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap)); memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment