gfx: drv: Free the correct pointer in psb_framebuffer_destroy()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 15 Feb 2012 13:02:45 +0000 (15:02 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:30:04 +0000 (12:30 +0300)
Pass the pointer to the psb_framebuffer structure to kfree(), not
the pointer to the embedded drm_framebuffer structure.

Luckily in this case the drm_framebuffer is embedded as the first
member inside psb_framebuffer, so the incorrect code didn't
manage to make a mess of things.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/drv/psb_fb.c

index df63a62..38e04b0 100644 (file)
@@ -633,7 +633,7 @@ static void psb_user_framebuffer_destroy(struct drm_framebuffer *fb)
        /* JB: TODO not drop, refcount buffer */
        drm_framebuffer_cleanup(fb);
 
-       kfree(fb);
+       kfree(psbfb);
 }
 
 static const struct drm_mode_config_funcs psb_mode_funcs = {