From: Laurent Pinchart Date: Thu, 5 Mar 2015 17:41:04 +0000 (+0200) Subject: drm: rcar-du: Fix framebuffer reference leak through plane state X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de115fac7388264f6f1865a12ea6e4101bd05c48;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm: rcar-du: Fix framebuffer reference leak through plane state Plane state duplication takes a reference to the framebuffer stored in the state, but state destroy doesn't release it. This causes a reference leak. Fix it. Signed-off-by: Laurent Pinchart --- diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 35a2f04ab799..210e5c3fd982 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -316,6 +316,9 @@ rcar_du_plane_atomic_duplicate_state(struct drm_plane *plane) static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane, struct drm_plane_state *state) { + if (state->fb) + drm_framebuffer_unreference(state->fb); + kfree(to_rcar_du_plane_state(state)); }