Commit 82e223a5 authored by Sean Paul's avatar Sean Paul Committed by Rob Clark

drm/msm: dpu: Fix memory leak caused by dropped reference

We are currently leaking a drm_crtc_commit struct for every atomic
commit containing plane state. The dpu plane destroy function cleans up
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: default avatarDoug Anderson <dianders@chromium.org>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent f926a2e1
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment