summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMahammad Ismayilzada <mahammad.ismayilzada@freescale.com>2015-06-23 22:18:43 (GMT)
committerHaiying Wang <Haiying.wang@freescale.com>2015-11-02 19:58:17 (GMT)
commit300c3ff86988bc13e310b58d9c7c786528697150 (patch)
tree75e7a1c088a4253f6279d036a145ce2cac307576
parent56e16e2ba7582bd85d462e6102ff5828a6c3282b (diff)
downloadlinux-fsl-qoriq-300c3ff86988bc13e310b58d9c7c786528697150.tar.xz
fsl-qbman: Handle memory leaks
Eliminate memory leaks on error paths Signed-off-by: Mahammad Ismayilzada <mahammad.ismayilzada@freescale.com> Change-Id: I36d1a35f9d48188a9dad043c78e90d787997ea19
-rw-r--r--drivers/staging/fsl_qbman/qman_high.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/staging/fsl_qbman/qman_high.c b/drivers/staging/fsl_qbman/qman_high.c
index c2e2250..80604b7 100644
--- a/drivers/staging/fsl_qbman/qman_high.c
+++ b/drivers/staging/fsl_qbman/qman_high.c
@@ -4456,7 +4456,9 @@ int qman_ceetm_cq_claim(struct qm_ceetm_cq **cq,
if (qman_ceetm_configure_cq(&cq_config)) {
pr_err("Can't configure the CQ#%d with CCGRID#%d\n",
idx, ccg->idx);
- return -EINVAL;
+ list_del(&p->node);
+ kfree(p);
+ return -EINVAL;
}
}
@@ -4503,6 +4505,8 @@ int qman_ceetm_cq_claim_A(struct qm_ceetm_cq **cq,
if (qman_ceetm_configure_cq(&cq_config)) {
pr_err("Can't configure the CQ#%d with CCGRID#%d\n",
idx, ccg->idx);
+ list_del(&p->node);
+ kfree(p);
return -EINVAL;
}
}
@@ -4549,6 +4553,8 @@ int qman_ceetm_cq_claim_B(struct qm_ceetm_cq **cq,
if (qman_ceetm_configure_cq(&cq_config)) {
pr_err("Can't configure the CQ#%d with CCGRID#%d\n",
idx, ccg->idx);
+ list_del(&p->node);
+ kfree(p);
return -EINVAL;
}
}
@@ -4814,6 +4820,8 @@ int qman_ceetm_lfq_claim(struct qm_ceetm_lfq **lfq,
if (qman_ceetm_configure_lfqmt(&lfqmt_config)) {
pr_err("Can't configure LFQMT for LFQID#%d @ CQ#%d\n",
lfqid, cq->idx);
+ list_del(&p->node);
+ kfree(p);
return -EINVAL;
}
*lfq = p;