Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afb6a6a0 authored by Andy Gross's avatar Andy Gross Committed by Greg Kroah-Hartman
Browse files

staging: omapdrm: fix crash when freeing bad fb



During unload, don't cleanup the framebuffer if it is not valid.

Signed-off-by: default avatarAndy Gross <andy.gross@ti.com>
Reviewed-by: default avatarRob Clark <rob.clark@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 279bf2e5
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -208,7 +208,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
	 */
	ret = omap_gem_get_paddr(fbdev->bo, &paddr, true);
	if (ret) {
		dev_err(dev->dev, "could not map (paddr)!\n");
		dev_err(dev->dev,
			"could not map (paddr)!  Skipping framebuffer alloc\n");
		ret = -ENOMEM;
		goto fail;
	}
@@ -388,8 +389,11 @@ void omap_fbdev_free(struct drm_device *dev)

	fbi = helper->fbdev;

	/* only cleanup framebuffer if it is present */
	if (fbi) {
		unregister_framebuffer(fbi);
		framebuffer_release(fbi);
	}

	drm_fb_helper_fini(helper);