mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-09 03:20:05 +00:00
ASoC: core: fix use after free in snd_soc_remove_platform()
commit decc27b01d 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b2764661eb
commit
403c9f08a3
@@ -4315,10 +4315,10 @@ void snd_soc_remove_platform(struct snd_soc_platform *platform)
|
|||||||
snd_soc_component_del_unlocked(&platform->component);
|
snd_soc_component_del_unlocked(&platform->component);
|
||||||
mutex_unlock(&client_mutex);
|
mutex_unlock(&client_mutex);
|
||||||
|
|
||||||
snd_soc_component_cleanup(&platform->component);
|
|
||||||
|
|
||||||
dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n",
|
dev_dbg(platform->dev, "ASoC: Unregistered platform '%s'\n",
|
||||||
platform->component.name);
|
platform->component.name);
|
||||||
|
|
||||||
|
snd_soc_component_cleanup(&platform->component);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_remove_platform);
|
EXPORT_SYMBOL_GPL(snd_soc_remove_platform);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user