aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-12-14 15:39:29 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-12-31 04:25:42 -0500
commitf8ef29ee45664e86805d4359e352a0a9acbd1d13 (patch)
tree795d2906b08cb6dc0df241acfa732708db323526
parente07323cf1bf2f45cf0e237f3d9990370d54fb714 (diff)
drm: omapdrm: Fix plane state free in plane reset handler
The plane reset handler frees the plane state and allocates a new default state, but when doing so attempt to free the plane state using the base plane state pointer instead of casting it to the driver-specific state object that has been allocated. Fix it by using the omap_plane_atomic_destroy_state() function to destroy the plane state instead of duplicating the code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [tomi.valkeinen@ti.com: move of the func into separate patch] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_plane.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index c3f637491a63..d75b197eff46 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -248,11 +248,10 @@ static void omap_plane_reset(struct drm_plane *plane)
248 struct omap_plane *omap_plane = to_omap_plane(plane); 248 struct omap_plane *omap_plane = to_omap_plane(plane);
249 struct omap_plane_state *omap_state; 249 struct omap_plane_state *omap_state;
250 250
251 if (plane->state && plane->state->fb) 251 if (plane->state) {
252 drm_framebuffer_unreference(plane->state->fb); 252 omap_plane_atomic_destroy_state(plane, plane->state);
253 253 plane->state = NULL;
254 kfree(plane->state); 254 }
255 plane->state = NULL;
256 255
257 omap_state = kzalloc(sizeof(*omap_state), GFP_KERNEL); 256 omap_state = kzalloc(sizeof(*omap_state), GFP_KERNEL);
258 if (omap_state == NULL) 257 if (omap_state == NULL)