drivers/staging/omapdrm/omap_fbdev.c: move free after uses
authorJulia Lawall <julia@diku.dk>
Mon, 9 Jan 2012 07:51:03 +0000 (08:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Feb 2012 22:14:12 +0000 (14:14 -0800)
Move the free after the final uses.

The semantic patch that makes this report is available
in scripts/coccinelle/free/kfree.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/omapdrm/omap_fbdev.c

index ba4530697fe8afc174e9f99a196714ad71732da6..96940bbfc6f433b833cc935e42f566f246e7c0d4 100644 (file)
@@ -377,11 +377,11 @@ void omap_fbdev_free(struct drm_device *dev)
 
        fbdev = to_omap_fbdev(priv->fbdev);
 
-       kfree(fbdev);
-
        /* this will free the backing object */
        if (fbdev->fb)
                fbdev->fb->funcs->destroy(fbdev->fb);
 
+       kfree(fbdev);
+
        priv->fbdev = NULL;
 }