]> 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)
commit83269faf88310163a3c07219d008cbeaf3f40ebd
treee6957c091e0e4d0521166fe1b535987393316124
parentb7defc5d98803d1c527f58fca1de73df057985a2
remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev()

[ Upstream commit af7df92183fe81c5d7eec3f4a15e99afcac98042 ]

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: 76780758a927 ("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