]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 8 Mar 2022 06:45:21 +0000 (06:45 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:58:08 +0000 (11:58 +0200)
commit10d482a9bee889d645b770519f2a91cbd5dbc69c
treef9a5ca15a7a89a415c88b8356ccf68d1cf8dfc96
parent56c8191c0d3c8cf52afa3c878ed25785a8797a4d
remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 07a5dcc4bed9d7cae54adf5aa10ff9f037a3204b ]

The device_node pointer is returned by of_parse_phandle() or
of_get_child_by_name() with refcount incremented.
We should use of_node_put() on it when done.

This function only call of_node_put(node) when of_address_to_resource
succeeds, missing error cases.

Fixes: 278d744c46fd ("remoteproc: qcom: Fix potential device node leaks")
Fixes: 051fb70fd4ea ("remoteproc: qcom: Driver for the self-authenticating Hexagon v5")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220308064522.13804-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit bd4771ba2cf9e18473a42b5b70175e50d67a64bb)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/remoteproc/qcom_q6v5_mss.c