1
0
Fork 0

MLK-11942 ASoC: fsl_asrc_m2m: free pair after allocating m2m failed

free pair after allocating m2m failed. Reported by coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 237a35db5b48b78250a019f891d9d746c3411d49)
pull/10/head
Zidan Wang 2015-12-02 11:02:12 +08:00 committed by Jason Liu
parent 131e7697fb
commit 6fd6b599e0
1 changed files with 6 additions and 1 deletions

View File

@ -827,7 +827,8 @@ static int fsl_asrc_open(struct inode *inode, struct file *file)
m2m = kzalloc(sizeof(struct fsl_asrc_m2m), GFP_KERNEL);
if (!m2m) {
dev_err(dev, "failed to allocate m2m resource\n");
return -ENOMEM;
ret = -ENOMEM;
goto out;
}
pair->private = m2m;
@ -843,6 +844,10 @@ static int fsl_asrc_open(struct inode *inode, struct file *file)
pm_runtime_get_sync(dev);
return 0;
out:
kfree(pair);
return ret;
}
static int fsl_asrc_close(struct inode *inode, struct file *file)