Message ID | 1670203687-42016-1-git-send-email-wangyufen@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | remoteproc: qcom_q6v5_pas: fix refcount leak in adsp_alloc_memory_region() | expand |
On 05/12/2022 02:28, Wang Yufen wrote: > The node returned by of_parse_phandle() with refcount incremented, > of_node_put() needs be called when finish using it. So add it in the > end of of_address_to_resource(). > > Fixes: 9e004f97161d ("remoteproc: qcom: Rename Hexagon v5 PAS driver") > Signed-off-by: Wang Yufen <wangyufen@huawei.com> > --- > drivers/remoteproc/qcom_q6v5_pas.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c > index 6afd094..24439a6 100644 > --- a/drivers/remoteproc/qcom_q6v5_pas.c > +++ b/drivers/remoteproc/qcom_q6v5_pas.c > @@ -449,6 +449,7 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp) > } > > ret = of_address_to_resource(node, 0, &r); > + of_node_put(node); > if (ret) > return ret; > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 6afd094..24439a6 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -449,6 +449,7 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp) } ret = of_address_to_resource(node, 0, &r); + of_node_put(node); if (ret) return ret;
The node returned by of_parse_phandle() with refcount incremented, of_node_put() needs be called when finish using it. So add it in the end of of_address_to_resource(). Fixes: 9e004f97161d ("remoteproc: qcom: Rename Hexagon v5 PAS driver") Signed-off-by: Wang Yufen <wangyufen@huawei.com> --- drivers/remoteproc/qcom_q6v5_pas.c | 1 + 1 file changed, 1 insertion(+)