]> Git Repo - linux.git/commitdiff
ASoC: hdac_hdmi: Potential NULL deref in hdac_hdmi_get_spk_alloc()
authorDan Carpenter <[email protected]>
Tue, 3 May 2016 07:42:58 +0000 (10:42 +0300)
committerMark Brown <[email protected]>
Tue, 3 May 2016 16:30:13 +0000 (17:30 +0100)
We intended || here instead of &&.  The original code potentially leads
to a NULL dereference.

Fixes: 2889099eb8cd ('ASoC: hdac_hdmi: Register chmap controls and ops')
Signed-off-by: Dan Carpenter <[email protected]>
Reviewd-by: Takashi Sakamoto <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Tested-by: Sachin Mokashi <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
sound/soc/codecs/hdac_hdmi.c

index 0ed39753c871e83cefac22cef6ef7f6e4abb939a..f1170e06023045488aa167af60216832a7087de7 100644 (file)
@@ -1614,7 +1614,7 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdac, int pcm_idx)
        struct hdac_hdmi_pcm *pcm = get_hdmi_pcm_from_id(hdmi, pcm_idx);
        struct hdac_hdmi_pin *pin = pcm->pin;
 
-       if (!pin && !pin->eld.eld_valid)
+       if (!pin || !pin->eld.eld_valid)
                return 0;
 
        return pin->eld.info.spk_alloc;
This page took 0.079607 seconds and 4 git commands to generate.