Skip to content

Commit

Permalink
drm: omapdrm: gem: Free the correct memory object
Browse files Browse the repository at this point in the history
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 <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Laurent Pinchart authored and Tomi Valkeinen committed Dec 31, 2015
1 parent ef3f4e9 commit 00e9c7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/omapdrm/omap_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 00e9c7c

Please sign in to comment.