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 <weiguang.kong@nxp.com>
This commit is contained in:
Weiguang Kong
2017-09-13 19:11:02 +08:00
committed by Dong Aisheng
parent 8dfa0f8731
commit db15cd2f98

View File

@ -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;
}