aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware/imx
diff options
context:
space:
mode:
authorGravatar Wei Yongjun <weiyongjun1@huawei.com> 2020-05-06 05:14:10 +0000
committerGravatar Shawn Guo <shawnguo@kernel.org> 2020-05-20 11:33:08 +0800
commit89f12d6509bff004852c51cb713a439a86816b24 (patch)
treeba65ea50f908f2700e3e4cb363b7f789ed10ad83 /drivers/firmware/imx
parentdt-bindings: firmware: imx: Add more system controls and PM clock types (diff)
downloadlinux-89f12d6509bff004852c51cb713a439a86816b24.tar.gz
linux-89f12d6509bff004852c51cb713a439a86816b24.tar.bz2
linux-89f12d6509bff004852c51cb713a439a86816b24.zip
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: edbee095fafb ("firmware: imx: add SCU firmware driver support") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/firmware/imx')
-rw-r--r--drivers/firmware/imx/imx-scu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/firmware/imx/imx-scu.c b/drivers/firmware/imx/imx-scu.c
index d02c00d0d5b5..2ab048222fe9 100644
--- a/drivers/firmware/imx/imx-scu.c
+++ b/drivers/firmware/imx/imx-scu.c
@@ -313,6 +313,7 @@ static int imx_scu_probe(struct platform_device *pdev)
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to request mbox chan %s ret %d\n",
chan_name, ret);
+ kfree(chan_name);
return ret;
}