Skip to content

Commit 89f12d6

Browse files
Wei YongjunShawn Guo
authored andcommitted
firmware: imx: scu: Fix possible memory leak in imx_scu_probe()
'chan_name' is malloced in imx_scu_probe() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: edbee09 ("firmware: imx: add SCU firmware driver support") Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 88d93af commit 89f12d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/firmware/imx/imx-scu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ static int imx_scu_probe(struct platform_device *pdev)
313313
if (ret != -EPROBE_DEFER)
314314
dev_err(dev, "Failed to request mbox chan %s ret %d\n",
315315
chan_name, ret);
316+
kfree(chan_name);
316317
return ret;
317318
}
318319

0 commit comments

Comments
 (0)