diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-03-05 12:41:04 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-03-19 06:00:21 -0400 |
commit | de115fac7388264f6f1865a12ea6e4101bd05c48 (patch) | |
tree | c1de8003b25ad3b5092b737a15f4f73b7e656f6f | |
parent | 343e0d2b58117f58afd3718e863addcc357c01de (diff) |
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 <laurent.pinchart+renesas@ideasonboard.com>
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_plane.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) | |||
316 | static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane, | 316 | static void rcar_du_plane_atomic_destroy_state(struct drm_plane *plane, |
317 | struct drm_plane_state *state) | 317 | struct drm_plane_state *state) |
318 | { | 318 | { |
319 | if (state->fb) | ||
320 | drm_framebuffer_unreference(state->fb); | ||
321 | |||
319 | kfree(to_rcar_du_plane_state(state)); | 322 | kfree(to_rcar_du_plane_state(state)); |
320 | } | 323 | } |
321 | 324 | ||