diff options
author | Daniel Mack <daniel@zonque.org> | 2014-10-07 13:41:23 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-14 10:10:22 -0800 |
commit | 403c9f08a334bb5429e28b99cb7f79bbad26e9af (patch) | |
tree | b9d01697b65a2609ba48adf4a97b3c2c18f95c0b /sound | |
parent | b2764661ebb812b6b52481280fcaea9f75901565 (diff) |
ASoC: core: fix use after free in snd_soc_remove_platform()
commit decc27b01d584c985c231e73d3b493de6ec07af8 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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 d074aa91b023..a3e0a0df9c75 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) snd_soc_component_del_unlocked(&platform->component); mutex_unlock(&client_mutex); - snd_soc_component_cleanup(&platform->component); - dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n", platform->component.name); + + snd_soc_component_cleanup(&platform->component); } EXPORT_SYMBOL_GPL(snd_soc_remove_platform); |