summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-05-06 05:14:10 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 17:50:30 +0200
commitad7f78b7ce3975fa6713b392dbcbfbf3cc2e3fe2 (patch)
tree71ac411c7c0cd308e827df7672135686db9e5af9 /drivers/firmware
parent95ea51b2690e24fc2f5a593ce52b2001c21ffbdc (diff)
downloadlinux-ad7f78b7ce3975fa6713b392dbcbfbf3cc2e3fe2.tar.gz
linux-ad7f78b7ce3975fa6713b392dbcbfbf3cc2e3fe2.tar.bz2
linux-ad7f78b7ce3975fa6713b392dbcbfbf3cc2e3fe2.zip
firmware: imx: scu: Fix possible memory leak in imx_scu_probe()
[ Upstream commit 89f12d6509bff004852c51cb713a439a86816b24 ] '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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/firmware')
-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 e48d971ffb61..a3b11bc71dcb 100644
--- a/drivers/firmware/imx/imx-scu.c
+++ b/drivers/firmware/imx/imx-scu.c
@@ -300,6 +300,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;
}