drm/fence: release fence reference when canceling event
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Thu, 20 Oct 2016 14:50:03 +0000 (12:50 -0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 21 Oct 2016 13:35:07 +0000 (15:35 +0200)
If the event gets canceled we also need to put away the fence
reference it holds.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1476975005-30441-3-git-send-email-gustavo@padovan.org
drivers/gpu/drm/drm_fops.c

index e84faecf52251e49efdb8c53b2ccca345299dd8d..8bed5f45918221962f4283922a25fe3778324a52 100644 (file)
@@ -663,6 +663,10 @@ void drm_event_cancel_free(struct drm_device *dev,
                list_del(&p->pending_link);
        }
        spin_unlock_irqrestore(&dev->event_lock, flags);
+
+       if (p->fence)
+               fence_put(p->fence);
+
        kfree(p);
 }
 EXPORT_SYMBOL(drm_event_cancel_free);