From: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
Cc: Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Subject: Re: [PATCH 1/2] drm/msm: dpu: Fix memory leak caused by dropped reference
Date: Tue, 09 Oct 2018 11:43:25 -0700 [thread overview]
Message-ID: <97dcf11ad4358eb4bf198048602da801@codeaurora.org> (raw)
In-Reply-To: <20181004180945.46132-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
On 2018-10-04 11:09, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
>
> We are currently leaking a drm_crtc_commit struct for every atomic
> commit containing plane state. The dpu plane destroy function cleans up
dpu plane destroy -> dpu_plane_destroy_state
> the fb reference manually, but fails to release the commit ref. As a
> result, we just keep allocating drm_crtc_commits without ever freeing
> them. Fortunately there's a helper function which will clean up all of
> our mess at once, so use that.
>
> Thanks to Doug Anderson for reporting the memory leak (and leaving
> breadcrumbs from kmemleak!).
>
> Reported-by: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
With the nit addressed:
Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>
> drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index fc59a69aa832..f549daf30fe6 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -1203,9 +1203,7 @@ static void dpu_plane_destroy_state(struct
> drm_plane
> *plane,
>
> pstate = to_dpu_plane_state(state);
>
> - /* remove ref count for frame buffers */
> - if (state->fb)
> - drm_framebuffer_put(state->fb);
> + __drm_atomic_helper_plane_destroy_state(state);
>
> kfree(pstate);
> }
--
Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-10-09 18:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-04 18:09 [PATCH 1/2] drm/msm: dpu: Fix memory leak caused by dropped reference Sean Paul
[not found] ` <20181004180945.46132-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-04 18:09 ` [PATCH 2/2] drm/msm: dpu: Remove checks from dpu_plane_destroy_state() Sean Paul
[not found] ` <20181004180945.46132-2-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-09 18:43 ` Jeykumar Sankaran
2018-10-09 18:43 ` Jeykumar Sankaran [this message]
[not found] ` <97dcf11ad4358eb4bf198048602da801-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-09 19:15 ` [PATCH 1/2] drm/msm: dpu: Fix memory leak caused by dropped reference Sean Paul
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=97dcf11ad4358eb4bf198048602da801@codeaurora.org \
--to=jsanka-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=abhinavk-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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.