From: Akhil P Oommen <quic_akhilpo@quicinc.com>
To: Miaoqian Lin <linmq006@gmail.com>,
Rob Clark <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
"David Airlie" <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Jonathan Marek <jonathan@marek.ca>,
"Jordan Crouse" <jordan@cosmicpenguin.net>,
<linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init
Date: Thu, 12 May 2022 19:29:43 +0530 [thread overview]
Message-ID: <e73e7ea8-137d-f204-c267-4bc1e63e7f6a@quicinc.com> (raw)
In-Reply-To: <20220512121955.56937-1-linmq006@gmail.com>
On 5/12/2022 5:49 PM, Miaoqian Lin wrote:
> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
>
> a6xx_gmu_init() passes the node to of_find_device_by_node()
> and of_dma_configure(), of_find_device_by_node() will takes its
> reference, of_dma_configure() doesn't need the node after usage.
>
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index ccc4fcf7a630..a8f6d73197b1 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -1919,6 +1919,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
> BUG_ON(!node);
>
> ret = a6xx_gmu_init(a6xx_gpu, node);
> + of_node_put(node);
> if (ret) {
> a6xx_destroy(&(a6xx_gpu->base.base));
> return ERR_PTR(ret);
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
-Akhil.
prev parent reply other threads:[~2022-05-12 14:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 12:19 Miaoqian Lin
2022-05-12 13:59 ` Akhil P Oommen [this message]
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=e73e7ea8-137d-f204-c267-4bc1e63e7f6a@quicinc.com \
--to=quic_akhilpo@quicinc.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jonathan@marek.ca \
--cc=jordan@cosmicpenguin.net \
--cc=linmq006@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®