Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757710AbcJTOuh (ORCPT ); Thu, 20 Oct 2016 10:50:37 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:35945 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757926AbcJTOue (ORCPT ); Thu, 20 Oct 2016 10:50:34 -0400 From: Gustavo Padovan To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Daniel Stone , Daniel Vetter , Rob Clark , Greg Hackmann , John Harrison , laurent.pinchart@ideasonboard.com, seanpaul@google.com, marcheu@google.com, m.chehab@samsung.com, Sumit Semwal , Maarten Lankhorst , Gustavo Padovan Subject: [PATCH v5 2/4] drm/fence: release fence reference when canceling event Date: Thu, 20 Oct 2016 12:50:03 -0200 Message-Id: <1476975005-30441-3-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1476975005-30441-1-git-send-email-gustavo@padovan.org> References: <1476975005-30441-1-git-send-email-gustavo@padovan.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 711 Lines: 27 From: Gustavo Padovan If the event gets canceled we also need to put away the fence reference it holds. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/drm_fops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index e84faec..8bed5f4 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -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); -- 2.5.5