All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Yufen <wangyufen@huawei.com>
To: <agross@kernel.org>, <andersson@kernel.org>,
	<konrad.dybcio@somainline.org>, <mathieu.poirier@linaro.org>,
	<lgirdwood@gmail.com>, <broonie@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>,
	Wang Yufen <wangyufen@huawei.com>
Subject: [PATCH] remoteproc: qcom_q6v5_pas: fix refcount leak in adsp_alloc_memory_region()
Date: Mon, 5 Dec 2022 09:28:07 +0800	[thread overview]
Message-ID: <1670203687-42016-1-git-send-email-wangyufen@huawei.com> (raw)

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;
 
-- 
1.8.3.1


             reply	other threads:[~2022-12-05  1:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05  1:28 Wang Yufen [this message]
2022-12-05  8:21 ` [PATCH] remoteproc: qcom_q6v5_pas: fix refcount leak in adsp_alloc_memory_region() Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1670203687-42016-1-git-send-email-wangyufen@huawei.com \
    --to=wangyufen@huawei.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.