ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 4 Jun 2018 11:13:26 +0000 (12:13 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 4 Jun 2018 13:56:22 +0000 (14:56 +0100)
commitff2faf1289c1f81b5b26b9451dd1c2006aac8db8
tree8acfe28455382fb48ccf996b5ae96bbdd3cc8ff3
parent0c24fdc00244cc08309e397e3783f2943221dc53
ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it

dapm_kcontrol_data is freed as part of dapm_kcontrol_free(), leaving the
paths pointer dangling in the list.

This leads to system crash when we try to unload and reload sound card.
I hit this bug during ADSP crash/reboot test case on Dragon board DB410c.

Without this patch, on SLAB Poisoning enabled build, kernel crashes with
"BUG kmalloc-128 (Tainted: G        W        ): Poison overwritten"

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
sound/soc/soc-dapm.c