Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed0739b5 authored by Libin Yang's avatar Libin Yang Committed by Takashi Iwai
Browse files

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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));