OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c195906
)
soc: fsl: dpio: fix memory leak of a struct qbman on error exit path
author
Colin Ian King
<colin.king@canonical.com>
Tue, 19 Feb 2019 14:05:17 +0000
(14:05 +0000)
committer
Li Yang
<leoyang.li@nxp.com>
Tue, 19 Feb 2019 20:59:39 +0000
(14:59 -0600)
Currently the error check for a null reg leaks a struct qbman
that was allocated earlier. Fix this by kfree'ing p on the error exit
path.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/dpio/qbman-portal.c
patch
|
blob
|
history
diff --git
a/drivers/soc/fsl/dpio/qbman-portal.c
b/drivers/soc/fsl/dpio/qbman-portal.c
index
0bddb85
..
5a73397
100644
(file)
--- a/
drivers/soc/fsl/dpio/qbman-portal.c
+++ b/
drivers/soc/fsl/dpio/qbman-portal.c
@@
-180,6
+180,7
@@
struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d)
reg = qbman_read_register(p, QBMAN_CINH_SWP_CFG);
if (!reg) {
pr_err("qbman: the portal is not enabled!\n");
+ kfree(p);
return NULL;
}