Skip to content

Commit

Permalink
ASoC: core: fix use after free in snd_soc_remove_platform()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Daniel Mack authored and Mark Brown committed Oct 7, 2014
1 parent 6596aa0 commit decc27b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit decc27b

Please sign in to comment.