From patchwork Sun Oct 23 18:31:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 9391147 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 2B3AB60762 for ; Sun, 23 Oct 2016 18:32:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1119528B2A for ; Sun, 23 Oct 2016 18:32:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3EED28B2E; Sun, 23 Oct 2016 18:32:05 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 7C43E28B2A for ; Sun, 23 Oct 2016 18:32:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 709C26E114; Sun, 23 Oct 2016 18:32:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8502A6E0F5; Sun, 23 Oct 2016 18:31:55 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id x23so9162255lfi.1; Sun, 23 Oct 2016 11:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=n3iRRBOdYOSbf8KVi+Syj/O3a88mCH+7/WzWek+yPMk=; b=Ez/5jjVnIzy7lLylMNT6T9cOf0VYBdaDfek8tcHZJV30AtwoIrXHdp/ejdkZIwNGLk LAfr8R7e3nJJDddDE550ut1JIS9UuiyqivBfRTP7FBOcBhECfJArTWfSOV8dNH0JW/7r ietBupBrzrGgt1rkwtzFDJtMEPrmBeH6BFm9Am2xCISFGN1FNahKTmIcH7GM63rnMrKq TZIbt/FReYidUTIN8s2hgfPgptMotczAziQd1x/+NYi1HbQzvSXFlVZ9xX1JMwhAUxP8 WlEMZtR4K3VZFA3zJ3WR3FeQSnErf0Dfsyjl/0G0cYzDKyykqL+/ExZ3zQj1XCkDc4L+ gzmA== 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; bh=n3iRRBOdYOSbf8KVi+Syj/O3a88mCH+7/WzWek+yPMk=; b=lysgruIxQJ3LTX6kNo8Ow7kKdT75pYy7TN3riH+Ij/hIBl86u/bZzSTGpv5mI9cRzc Msnw3QVOyDtpUEyDD7E2cxXQGrm91FOt+eb5pzY7EZx9bDqC6GBJeibMKhJRDnMjPgTs rCL/gn4pO/CsCNwEUf9M2r6Giz9Zz1lxtqh+7N8e8joPFk4nQJs5NiMN9+Bzvb6k/AId drwuoiBQZxVo5SkIlSSnbmTIR5iGQKvuVqizCMnZb5uyTn+QfYLdNJh/jh30O4StDoRv fAi91pw163jETYgc8POaE6MEswOyxVqGyVjNhRhkfb1IhtMrjTsCyYZaw2JtmJOoFeVU gHtQ== X-Gm-Message-State: ABUngvfMT4kzA99PCmRkTrUgKEaRgxNt/ROFMPEN9TU/olZuvDKn3lyn7fWwd4pf5roU4Q== X-Received: by 10.25.29.1 with SMTP id d1mr4933530lfd.121.1477247513706; Sun, 23 Oct 2016 11:31:53 -0700 (PDT) Received: from localhost.localdomain ([5.20.238.37]) by smtp.gmail.com with ESMTPSA id 79sm2362855lja.16.2016.10.23.11.31.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Oct 2016 11:31:53 -0700 (PDT) From: Grazvydas Ignotas To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: fix a vm_flush fence leak Date: Sun, 23 Oct 2016 21:31:45 +0300 Message-Id: <1477247507-11378-3-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 2.7.4 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 Looks like .last_flush reference is left at teardown. Leak reported by CONFIG_SLUB_DEBUG. Fixes: 41d9eb2c5a2a ("drm/amdgpu: add a fence after the VM flush") Signed-off-by: Grazvydas Ignotas Reviewed-by: Chunming Zhou Reviewed-by: Christian König . --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index ded57dd..d6c2839 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1774,5 +1774,6 @@ void amdgpu_vm_manager_fini(struct amdgpu_device *adev) fence_put(adev->vm_manager.ids[i].first); amdgpu_sync_free(&adev->vm_manager.ids[i].active); fence_put(id->flushed_updates); + fence_put(id->last_flush); } }