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:32:52 +0000 (13:32 +0100)
commitec97e9a5c2f25d2f9f9d7005e9ac67f23cc751cd
tree784ed0bdcc3a3476899f44162e69fc9d5757168e
parentb773e86fc1968c2483c836db26b976ab6cbef7a1
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