From cbf97455c2911ff6d98bf201cfe3d156df8a0bcb Mon Sep 17 00:00:00 2001 From: qjb Date: Mon, 7 Jul 2014 15:58:53 +0800 Subject: [PATCH] rk616 codec: fixed rk616 codec shutdown function null pointer --- sound/soc/codecs/rk616_codec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rk616_codec.c b/sound/soc/codecs/rk616_codec.c index c66c747deb7d..cd812be5a8ac 100755 --- a/sound/soc/codecs/rk616_codec.c +++ b/sound/soc/codecs/rk616_codec.c @@ -3243,8 +3243,14 @@ void rk616_platform_shutdown(struct platform_device *pdev) mdelay(10); snd_soc_write(codec, RK616_RESET, 0x3); - kfree(rk616); - rk616_priv = NULL; + if (rk616) { + kfree(rk616); + printk("rk616 = %d, rk616_priv = %d\n", rk616, rk616_priv); + if (rk616_priv) + rk616_priv = NULL; + rk616_codec_power_up(RK616_CODEC_PLAYBACK); + } + } static struct platform_driver rk616_codec_driver = { -- 2.34.1