]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: hdac_hdmi: avoid reference to invalid variable of the pin list
authorJeeja KP <jeeja.kp@intel.com>
Wed, 1 Mar 2017 17:11:23 +0000 (22:41 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 6 Mar 2017 10:42:29 +0000 (11:42 +0100)
commit3d102e560fabe09dabaed280271b98a9896ba80f
tree209653f1c1219571a5f005bdd12bfa937b32a256
parent94e2a518d0ac4a168bccd1446b1a1407458c45bd
ASoC: hdac_hdmi: avoid reference to invalid variable of the pin list

Using pin list array iterator outside the iteration of the list can
point to dummy element, which can be invalid. So don't use pin variable
outside the pin list iteration.

This fixes the following coccinelle warning:
sound/soc/codecs/hdac_hdmi.c:1419:5-8: ERROR: invalid reference to the
index variable of the iterator

Fixes: e1b891e06062('ASoC: hdac_hdmi: Add support to handle MST capable pin')
Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdac_hdmi.c