Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA - hda: hdmi check NULL pointer in hdmi_set_chmap

Make sure per_pin is not NULL before using it.

Fixes: 9b3dc8aa3fb1 ('ALSA: hda - Register chmap obj as priv data instead of codec')
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Libin Yang and committed by
Takashi Iwai
ed0739b5 50fd4987

+2
+2
sound/pci/hda/patch_hdmi.c
··· 1858 1858 struct hdmi_spec *spec = codec->spec; 1859 1859 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); 1860 1860 1861 + if (!per_pin) 1862 + return; 1861 1863 mutex_lock(&per_pin->lock); 1862 1864 per_pin->chmap_set = true; 1863 1865 memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap));