remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev()
authorGaosheng Cui <cuigaosheng1@huawei.com>
Tue, 29 Nov 2022 10:56:50 +0000 (18:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:36 +0000 (13:14 +0100)
commit131c0a3ead78d45f0f39ddb42cf1bd9be26239b0
treebde4ec648c91f9afc905382516f6d46a70e1d45c
parent4507c6a6723400d72d6da346bcc6eddedac923d9
remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev()

[ Upstream commit e01ce676aaef3b13d02343d7e70f9637d93a3367 ]

The kfree() should be called when of_irq_get_byname() fails or
devm_request_threaded_irq() fails in qcom_add_sysmon_subdev(),
otherwise there will be a memory leak, so add kfree() to fix it.

Fixes: 027045a6e2b7 ("remoteproc: qcom: Add shutdown-ack irq")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221129105650.1539187-1-cuigaosheng1@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/qcom_sysmon.c