[PATCH 2/3] drm/omap: crtc/encoder/fb destroy cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rob Clark <rob@xxxxxx>

Signed-off-by: Rob Clark <rob@xxxxxx>
---
 drivers/staging/omapdrm/omap_crtc.c    |    3 +--
 drivers/staging/omapdrm/omap_encoder.c |    3 +--
 drivers/staging/omapdrm/omap_fb.c      |    6 ++----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_crtc.c b/drivers/staging/omapdrm/omap_crtc.c
index fd09bcf..cffdf5e 100644
--- a/drivers/staging/omapdrm/omap_crtc.c
+++ b/drivers/staging/omapdrm/omap_crtc.c
@@ -320,8 +320,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 
 fail:
 	if (crtc) {
-		drm_crtc_cleanup(crtc);
-		kfree(omap_crtc);
+		omap_crtc_destroy(crtc);
 	}
 	return NULL;
 }
diff --git a/drivers/staging/omapdrm/omap_encoder.c b/drivers/staging/omapdrm/omap_encoder.c
index 83bacd8..06c52cb 100644
--- a/drivers/staging/omapdrm/omap_encoder.c
+++ b/drivers/staging/omapdrm/omap_encoder.c
@@ -164,8 +164,7 @@ struct drm_encoder *omap_encoder_init(struct drm_device *dev,
 
 fail:
 	if (encoder) {
-		drm_encoder_cleanup(encoder);
-		kfree(omap_encoder);
+		omap_encoder_destroy(encoder);
 	}
 
 	return NULL;
diff --git a/drivers/staging/omapdrm/omap_fb.c b/drivers/staging/omapdrm/omap_fb.c
index 491be53..3f62505 100644
--- a/drivers/staging/omapdrm/omap_fb.c
+++ b/drivers/staging/omapdrm/omap_fb.c
@@ -53,11 +53,9 @@ static void omap_framebuffer_destroy(struct drm_framebuffer *fb)
 
 	drm_framebuffer_cleanup(fb);
 
-	if (omap_gem_put_paddr(omap_fb->bo)) {
-		dev_err(dev->dev, "could not unmap!\n");
-	}
-
 	if (omap_fb->bo) {
+		if (omap_fb->paddr && omap_gem_put_paddr(omap_fb->bo))
+			dev_err(dev->dev, "could not unmap!\n");
 		drm_gem_object_unreference_unlocked(omap_fb->bo);
 	}
 
-- 
1.7.5.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux