diff options
author | Daniel Mack <daniel@zonque.org> | 2014-10-07 07:41:23 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-07 08:12:28 -0400 |
commit | decc27b01d584c985c231e73d3b493de6ec07af8 (patch) | |
tree | f8a453869deb5eea00e7f41ec4f1f8de5c492be2 /sound | |
parent | 6596aa047b624aeec2ea321962cfdecf9953a383 (diff) |
ASoC: core: fix use after free in snd_soc_remove_platform()
Coverity spotted an use-after-free condition in snd_soc_remove_platform().
Fix this by moving snd_soc_component_cleanup() after the debug print
statement which uses the component's string.
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index ae48f1013e80..d877ec57d761 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -4315,10 +4315,10 @@ void snd_soc_remove_platform(struct snd_soc_platform *platform) | |||
4315 | snd_soc_component_del_unlocked(&platform->component); | 4315 | snd_soc_component_del_unlocked(&platform->component); |
4316 | mutex_unlock(&client_mutex); | 4316 | mutex_unlock(&client_mutex); |
4317 | 4317 | ||
4318 | snd_soc_component_cleanup(&platform->component); | ||
4319 | |||
4320 | dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n", | 4318 | dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n", |
4321 | platform->component.name); | 4319 | platform->component.name); |
4320 | |||
4321 | snd_soc_component_cleanup(&platform->component); | ||
4322 | } | 4322 | } |
4323 | EXPORT_SYMBOL_GPL(snd_soc_remove_platform); | 4323 | EXPORT_SYMBOL_GPL(snd_soc_remove_platform); |
4324 | 4324 | ||