From 00e9c7c7002de36dd247745c825d4663c65e0a5b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 14 Dec 2015 22:39:38 +0200 Subject: [PATCH] drm: omapdrm: gem: Free the correct memory object The GEM object free handler frees memory allocated by the driver using the pointer to the drm_gem_object instead of the pointer to the omap_gem_object that embeds it. This doesn't cause any issue in practice as the drm_gem_object is the first field of omap_gem_object, but would cause memory corruption if the structure layout changes. Fix it. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 391bc7378f9f..d9ce296eec6a 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -1345,7 +1345,7 @@ void omap_gem_free_object(struct drm_gem_object *obj) drm_gem_object_release(obj); - kfree(obj); + kfree(omap_obj); } /* GEM buffer object constructor */ -- 2.34.1