summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-12-02 11:02:12 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:02:40 -0600
commit1c917ffbb81d8e5f3564fdd112da6a2da55b9ee4 (patch)
tree72f0c95e67d372de6b8a3288cb86440d0e35e6e6 /sound
parentcd1c1613f4f4333f229837dd330d1ea1dbe83be9 (diff)
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)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_asrc_m2m.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index 8de37d46940d..0caed6233b6b 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -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)