]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/omap: fix omap_fbdev_free() when omap_fbdev_create() wasn't called
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 9 Feb 2018 07:30:44 +0000 (09:30 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 1 Mar 2018 07:18:18 +0000 (09:18 +0200)
If we have no crtcs/connectors, fbdev init goes fine, but
omap_fbdev_create() is never called. This means that omap_fbdev->bo is
NULL and omap_fbdev_free() crashes.

Add a check to omap_fbdev_free() to handle the NULL case.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/omapdrm/omap_fbdev.c

index 1ace63e2ff22bbf064c4788be85d58f84cdfdad1..632ebcf2165f5363fc911c84122637e3ada0aedc 100644 (file)
@@ -303,7 +303,8 @@ void omap_fbdev_free(struct drm_device *dev)
        fbdev = to_omap_fbdev(priv->fbdev);
 
        /* unpin the GEM object pinned in omap_fbdev_create() */
-       omap_gem_unpin(fbdev->bo);
+       if (fbdev->bo)
+               omap_gem_unpin(fbdev->bo);
 
        /* this will free the backing object */
        if (fbdev->fb)