Commit e6204a58 authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: fix omap_fbdev_free() when omap_fbdev_create() wasn't called

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent f9b34a0f
...@@ -303,7 +303,8 @@ void omap_fbdev_free(struct drm_device *dev) ...@@ -303,7 +303,8 @@ void omap_fbdev_free(struct drm_device *dev)
fbdev = to_omap_fbdev(priv->fbdev); fbdev = to_omap_fbdev(priv->fbdev);
/* unpin the GEM object pinned in omap_fbdev_create() */ /* 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 */ /* this will free the backing object */
if (fbdev->fb) if (fbdev->fb)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment