aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibin Yang <libin.yang@linux.intel.com>2016-04-17 21:16:28 -0400
committerTakashi Iwai <tiwai@suse.de>2016-04-18 01:27:08 -0400
commited0739b577f2ddd53835f1e20d014fccab195c42 (patch)
treef10b5731389166f632eb6f5e7cd01c8c670f66b6
parent50fd4987c4f3c3ebf0ce94d932732011bbdc7c71 (diff)
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>
-rw-r--r--sound/pci/hda/patch_hdmi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index c83c1a8d9742..40933aa33afe 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1858,6 +1858,8 @@ static void hdmi_set_chmap(struct hdac_device *hdac, int pcm_idx,
1858 struct hdmi_spec *spec = codec->spec; 1858 struct hdmi_spec *spec = codec->spec;
1859 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); 1859 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx);
1860 1860
1861 if (!per_pin)
1862 return;
1861 mutex_lock(&per_pin->lock); 1863 mutex_lock(&per_pin->lock);
1862 per_pin->chmap_set = true; 1864 per_pin->chmap_set = true;
1863 memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap)); 1865 memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap));