ASoC: wm5110: Unregister compressed platform when driver is removed
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
Thu, 21 Jan 2016 14:41:12 +0000 (14:41 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 22 Jan 2016 16:42:23 +0000 (16:42 +0000)
The driver was not unregistering the compressed platform in
wm5110_remove(). If the codec is built as a module, this would
lead to a NULL pointer deref if the module was unloaded and then
re-probed.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm5110.c

index c3640960183589eac7856e0edcbc77647c5e78f7..cd1b3080a497465ed4357094d98eb9a7c5c0b32e 100644 (file)
@@ -2358,6 +2358,7 @@ error:
 
 static int wm5110_remove(struct platform_device *pdev)
 {
+       snd_soc_unregister_platform(&pdev->dev);
        snd_soc_unregister_codec(&pdev->dev);
        pm_runtime_disable(&pdev->dev);