drm/nouveau/nouveau: fix memory leak in nouveau_crtc_page_flip()
authorChristian Engelmayer <cengelma@gmx.at>
Sun, 29 Dec 2013 22:08:54 +0000 (23:08 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 8 Jan 2014 06:17:48 +0000 (16:17 +1000)
Fix a memory leak in the nouveau_crtc_page_flip() error handling path.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_display.c

index 29c3efd..25ea82f 100644 (file)
@@ -610,7 +610,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
        ret = nouveau_fence_sync(fence, chan);
        nouveau_fence_unref(&fence);
        if (ret)
-               return ret;
+               goto fail_free;
 
        if (new_bo != old_bo) {
                ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM);