]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: drm/omap: crtc/encoder/fb destroy cleanups
authorRob Clark <rob@ti.com>
Sat, 10 Dec 2011 05:26:07 +0000 (23:26 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 13 Dec 2011 00:37:52 +0000 (16:37 -0800)
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/omapdrm/omap_crtc.c
drivers/staging/omapdrm/omap_encoder.c
drivers/staging/omapdrm/omap_fb.c

index fd09bcfab858e0b0f0de662538db9d25a6ebd746..cffdf5e1239424331edb51f45528139255263626 100644 (file)
@@ -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;
 }
index 83bacd8fd3629466d553f04b273baea5b64aa8e2..06c52cb62d2f0e78666b13b02ba8c300031d3088 100644 (file)
@@ -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;
index 491be5395d851d6f9ec04feedebc3f3626581afc..3f62505813c23ff740282aad147bc97a57a0dcf0 100644 (file)
@@ -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);
        }