Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd3bd3b3 authored by Colin Ian King's avatar Colin Ian King Committed by Li Yang
Browse files

soc: fsl: dpio: fix memory leak of a struct qbman on error exit path



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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarLi Yang <leoyang.li@nxp.com>
parent c1959066
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}