From db15cd2f98001063a91561e1a4346e02722fccbb Mon Sep 17 00:00:00 2001 From: Weiguang Kong Date: Wed, 13 Sep 2017 19:11:02 +0800 Subject: [PATCH] MLK-16450-2: ASoC: fsl_hifi4: free unused memory when closing device free unused memory which is allocated in fsl_hifi4_open() function when closing the hifi4 device. Signed-off-by: Weiguang Kong --- sound/soc/fsl/fsl_hifi4.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/fsl/fsl_hifi4.c b/sound/soc/fsl/fsl_hifi4.c index d1052d99cd7d..63deb668c79d 100644 --- a/sound/soc/fsl/fsl_hifi4.c +++ b/sound/soc/fsl/fsl_hifi4.c @@ -1201,6 +1201,13 @@ static int fsl_hifi4_open(struct inode *inode, struct file *file) static int fsl_hifi4_close(struct inode *inode, struct file *file) { + struct fsl_hifi4 *hifi4_priv = dev_get_drvdata(hifi4_miscdev.parent); + struct device *dev = hifi4_priv->dev; + struct fsl_hifi4_engine *hifi4_engine; + + hifi4_engine = file->private_data; + devm_kfree(dev, hifi4_engine); + return 0; }