From patchwork Tue Sep 22 18:02:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: robert.beckett@intel.com X-Patchwork-Id: 7242421 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D0179F32B for ; Tue, 22 Sep 2015 18:00:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E8D320A2D for ; Tue, 22 Sep 2015 18:00:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 63337205FD for ; Tue, 22 Sep 2015 18:00:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B4F56EA9B; Tue, 22 Sep 2015 11:00:29 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id BF9256EA9B for ; Tue, 22 Sep 2015 11:00:28 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 22 Sep 2015 11:00:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,574,1437462000"; d="scan'208";a="774689795" Received: from robertbe-linux.isw.intel.com ([10.102.226.154]) by orsmga001.jf.intel.com with ESMTP; 22 Sep 2015 11:00:27 -0700 From: robert.beckett@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 22 Sep 2015 19:02:39 +0100 Message-Id: <1442944959-29467-1-git-send-email-robert.beckett@intel.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Intel-gfx] [PATCH i-g-t] tests/gem_storedw_loop: Fix use after free for bufmgr X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Beckett Move bufmgr destruction to end of tests. This avoids use after free on successive tests. This could be squashed with the following patch to aid bisectability: commit 0679702150157706a6def66b893b29c16345f4db Author: Jesse Barnes Date: Wed Aug 5 16:06:31 2015 -0700 tests/gem_storedw_loop: add new store_dword test to unify per-ring ones v2 Signed-off-by: Robert Beckett Cc: Jesse Barnes Reviewed-by: Jesse Barnes --- tests/gem_storedw_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gem_storedw_loop.c b/tests/gem_storedw_loop.c index 10b12d4..e7ebcc2 100644 --- a/tests/gem_storedw_loop.c +++ b/tests/gem_storedw_loop.c @@ -128,7 +128,6 @@ store_test(int ring, int count) drm_intel_bo_unreference(target_buffer); intel_batchbuffer_free(batch); - drm_intel_bufmgr_destroy(bufmgr); } struct ring { @@ -181,5 +180,6 @@ igt_main } } + drm_intel_bufmgr_destroy(bufmgr); close(fd); }