ASoC: hdac_hdmi: don't update the iterator in pcm list remove
authorJeeja KP <jeeja.kp@intel.com>
Wed, 1 Mar 2017 17:11:24 +0000 (22:41 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 6 Mar 2017 10:42:34 +0000 (11:42 +0100)
commit2fe42dd0f13812d38daaf05bcb1fd996afd0e87a
tree1e71dc34ef66c24b44bb7da88a1f84cb81bb0e7f
parent04c8f2bf9117de7b8e8bc0b90e8c4bff15f4f613
ASoC: hdac_hdmi: don't update the iterator in pcm list remove

Fix not to update the iterator element, instead use list_del to remove
entry from the list.

This fixes the following coccinelle and static checker warning:
sound/soc/codecs/hdac_hdmi.c:1884:2-21:iterator with update on line
1885
sound/soc/codecs/hdac_hdmi.c:2011 hdac_hdmi_dev_remove()
error: potential NULL dereference 'port'.

Fixes: e0e5d3e5a53b('ASoC: hdac_hdmi: Add support for multiple ports to a PCM')
Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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