diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2018-06-04 12:13:26 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-11-20 18:05:08 +0000 |
commit | c0c1975eacb1da432c904f214519cae0aa62137c (patch) | |
tree | abc416b0d9085722f769d98e1a2c79d1525e9c6b | |
parent | 35de64ab2673a8e6268a400c4e8f3fef06b01104 (diff) | |
download | linux-stable-c0c1975eacb1da432c904f214519cae0aa62137c.tar.gz linux-stable-c0c1975eacb1da432c904f214519cae0aa62137c.tar.bz2 linux-stable-c0c1975eacb1da432c904f214519cae0aa62137c.zip |
ASoC: dapm: delete dapm_kcontrol_data paths list before freeing it
commit ff2faf1289c1f81b5b26b9451dd1c2006aac8db8 upstream.
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | sound/soc/soc-dapm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ba2e25318d7e..8c07cd22bd02 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -254,6 +254,8 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, static void dapm_kcontrol_free(struct snd_kcontrol *kctl) { struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl); + + list_del(&data->paths); kfree(data->wlist); kfree(data); } |