]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Wed, 18 Jan 2023 10:41:31 +0000 (11:41 +0100)
commit71f076a7e9c835c33d37c7d113b56681d1942d19
treee6957c091e0e4d0521166fe1b535987393316124
parent1df66f0e11f9c3f5d3a9e69c4cc821761bbd9f31
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: 7ae605b033d6 ("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