From patchwork Thu Oct 20 14:50:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9387011 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 567DA607D0 for ; Thu, 20 Oct 2016 14:56:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12BA429C34 for ; Thu, 20 Oct 2016 14:56:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 079DD29C3C; Thu, 20 Oct 2016 14:56:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9184529C34 for ; Thu, 20 Oct 2016 14:56:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37CE76E8EA; Thu, 20 Oct 2016 14:56:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vk0-x243.google.com (mail-vk0-x243.google.com [IPv6:2607:f8b0:400c:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2F29B6E97F for ; Thu, 20 Oct 2016 14:51:43 +0000 (UTC) Received: by mail-vk0-x243.google.com with SMTP id 2so3089832vkb.1 for ; Thu, 20 Oct 2016 07:51:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aWN2GniPbp7/QC8Y3wm8+flhZWIPftoLLBGflOrsQ6Y=; b=OMi8Tvoy9XUxDwrTXT2oFMjX8RWh22eDswTrx1X8bmkrqPZID9jMX7CE+90v5pk7iZ rbV2K5MZJx82912nFPSqLQC9xMwzKGPpgH49vgtPWmuCok5PQ3zfnuQwHsYj+FM/yxoI Oyhxm6m9i9N9hsRkWb/zFfUW8EKBugtrJoQfv2oCxHeUnFY7MHn8YAoVM7NXN/UXSdlm fjEqbkdShCQT1Vh4gR6AkZ/BCgGK6NcYq6C4YUhGMtrb7Buc4zPNCd1gUThfyZPymx/l nKSg4xAX0ooPs4pMO3wG1pH+iImsC0nGgIBQwHSauWLgKDVOMPNRnMvXDg/4sKvoZfq8 tfSw== X-Gm-Message-State: AA6/9Rn7JfJ1BXJ3yLJOAK1Ff5cMqu9tNfqs5NizEsM4utMgB6w/FdBD1wm3AkhTqH6EGA== X-Received: by 10.31.16.73 with SMTP id g70mr1484897vki.175.1476975028299; Thu, 20 Oct 2016 07:50:28 -0700 (PDT) Received: from jade.localdomain ([187.64.228.41]) by smtp.gmail.com with ESMTPSA id n73sm17169910vkf.24.2016.10.20.07.50.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2016 07:50:27 -0700 (PDT) From: Gustavo Padovan To: dri-devel@lists.freedesktop.org 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> Cc: marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, Gustavo Padovan , John Harrison , m.chehab@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan If the event gets canceled we also need to put away the fence reference it holds. Signed-off-by: Gustavo Padovan Reviewed-by: Daniel Vetter --- 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);