firmware: imx: scu: Fix possible memory leak in imx_scu_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 6 May 2020 05:14:10 +0000 (05:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:50:30 +0000 (17:50 +0200)
commitad7f78b7ce3975fa6713b392dbcbfbf3cc2e3fe2
tree71ac411c7c0cd308e827df7672135686db9e5af9
parent95ea51b2690e24fc2f5a593ce52b2001c21ffbdc
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>
drivers/firmware/imx/imx-scu.c