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

Commit 8f658815 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

ASoC: hdac_hdmi: Potential NULL deref in hdac_hdmi_get_spk_alloc()



We intended || here instead of &&.  The original code potentially leads
to a NULL dereference.

Fixes: 2889099e ('ASoC: hdac_hdmi: Register chmap controls and ops')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewd-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Tested-by: default avatarSachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ea5a137d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;