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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:40:26 +0000 (14:40 +0200)
commitf7210ca29a783c94478da02368731e4c9cf7cdb7
tree3c7a30e4feb2a54a128255ff74281ec9cc59f76e
parent7a494580a89b73662b1cfe2e3c1ee4bb8ff5b5d9
remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region

[ 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>
drivers/remoteproc/qcom_q6v5_mss.c