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:
committed by
Dong Aisheng
parent
8dfa0f8731
commit
db15cd2f98
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user