aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_fbdev.c
diff options
context:
space:
mode:
authorTomi Valkeinen <[email protected]>2018-02-09 07:30:44 +0000
committerTomi Valkeinen <[email protected]>2018-03-01 07:18:18 +0000
commite6204a58b9e9ad01ab9c6d4b8b2b8b9c4e38bbba (patch)
treee3cbd9eef09a592bcf3e25438d6f3edf61e19954 /drivers/gpu/drm/omapdrm/omap_fbdev.c
parentdrm/omap: fbdev: avoid double initializer entry (diff)
downloadkernel-e6204a58b9e9ad01ab9c6d4b8b2b8b9c4e38bbba.tar.gz
kernel-e6204a58b9e9ad01ab9c6d4b8b2b8b9c4e38bbba.zip
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: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fbdev.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_fbdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 1ace63e2ff22..632ebcf2165f 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -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)