From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 10/15] drm: omapdrm: gem: Free the correct memory object
Date: Mon, 14 Dec 2015 21:52:10 +0200 [thread overview]
Message-ID: <9359718.HdSXMymZoL@avalon> (raw)
In-Reply-To: <566EABE8.8060808@ti.com>
Hi Tomi,
On Monday 14 December 2015 13:45:44 Tomi Valkeinen wrote:
> On 05/12/15 00:27, Laurent Pinchart wrote:
> > 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>
> > ---
> >
> > 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 644dff8ab516..f24bb71d9946
> > 100644
> > --- a/drivers/gpu/drm/omapdrm/omap_gem.c
> > +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
> > @@ -1336,7 +1336,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 */
>
> There's another kfree(obj) in omap_gem_new_handle().
Good point. I'll add a patch to fix that and submit v2.
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-12-14 19:52 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 22:27 [PATCH 00/15] omapdrm: Implement dma_buf import Laurent Pinchart
2015-12-04 22:27 ` [PATCH 01/15] drm: omapdrm: Fix plane state free in plane reset handler Laurent Pinchart
2015-12-09 12:43 ` Tomi Valkeinen
2015-12-13 20:39 ` Laurent Pinchart
2015-12-14 7:59 ` Tomi Valkeinen
2015-12-04 22:27 ` [PATCH 02/15] drm: omapdrm: Make fbdev emulation optional Laurent Pinchart
2015-12-04 22:27 ` [PATCH 03/15] drm: omapdrm: gem: Remove unused function prototypes Laurent Pinchart
2015-12-04 22:27 ` [PATCH 04/15] drm: omapdrm: gem: Remove forward declarations Laurent Pinchart
2015-12-04 22:27 ` [PATCH 05/15] drm: omapdrm: gem: Group functions by purpose Laurent Pinchart
2015-12-04 22:27 ` [PATCH 06/15] drm: omapdrm: gem: Move global usergart variable to omap_drm_private Laurent Pinchart
2015-12-04 22:27 ` [PATCH 07/15] drm: omapdrm: gem: Remove omap_drm_private has_dmm field Laurent Pinchart
2015-12-04 22:27 ` [PATCH 08/15] drm: omapdrm: gem: Mask out private flags passed from userspace Laurent Pinchart
2015-12-07 14:13 ` Emil Velikov
2015-12-14 20:33 ` Laurent Pinchart
2015-12-16 17:33 ` Emil Velikov
2015-12-16 23:27 ` Rob Clark
2015-12-04 22:27 ` [PATCH 09/15] drm: omapdrm: gem: Clean up GEM objects memory flags Laurent Pinchart
2015-12-04 22:27 ` [PATCH 10/15] drm: omapdrm: gem: Free the correct memory object Laurent Pinchart
2015-12-14 11:45 ` Tomi Valkeinen
2015-12-14 19:52 ` Laurent Pinchart [this message]
2015-12-04 22:27 ` [PATCH 11/15] drm: omapdrm: gem: Don't free mmap offset twice Laurent Pinchart
2015-12-04 22:27 ` [PATCH 12/15] drm: omapdrm: gem: Simplify error handling when creating GEM object Laurent Pinchart
2015-12-04 22:27 ` [PATCH 13/15] drm: omapdrm: gem: Remove check for impossible condition Laurent Pinchart
2015-12-04 22:27 ` [PATCH 14/15] drm: omapdrm: gem: Refactor GEM object allocation Laurent Pinchart
2015-12-04 22:27 ` [PATCH 15/15] drm: omapdrm: gem: Implement dma_buf import Laurent Pinchart
2015-12-05 15:40 ` Daniel Vetter
2015-12-05 22:24 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9359718.HdSXMymZoL@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox