From patchwork Thu Sep 24 10:13:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 7256011 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E13F6BEEC1 for ; Thu, 24 Sep 2015 10:22:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14AEB208DC for ; Thu, 24 Sep 2015 10:22:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C1C4A208B1 for ; Thu, 24 Sep 2015 10:22:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C6906E7C3; Thu, 24 Sep 2015 03:22:49 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id F1B3A6E7C3 for ; Thu, 24 Sep 2015 03:22:47 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 24 Sep 2015 03:22:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,580,1437462000"; d="scan'208";a="796325466" Received: from otc-vmt1.isw.intel.com ([10.237.224.80]) by fmsmga001.fm.intel.com with ESMTP; 24 Sep 2015 03:22:46 -0700 From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 24 Sep 2015 11:13:14 +0100 Message-Id: <1443089594-20673-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH i-g-t] gem_storedw_loop: fix segfault when listing subtests 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 Commit fb66cd5 (tests/gem_storedw_loop: Fix use after free for bufmgr) introduced a segmentation fault when listing subtests because drm_intel_bufmgr_destroy is called with NULL. Move this and the call to the close function inside an igt_fixture block to prevent them being called when listing subtests. Cc: Robert Beckett Cc: Jesse Barnes Cc: Daniel Vetter Signed-off-by: Thomas Wood Acked-by: Jesse Barnes --- tests/gem_storedw_loop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/gem_storedw_loop.c b/tests/gem_storedw_loop.c index e7ebcc2..e17e190 100644 --- a/tests/gem_storedw_loop.c +++ b/tests/gem_storedw_loop.c @@ -180,6 +180,8 @@ igt_main } } - drm_intel_bufmgr_destroy(bufmgr); - close(fd); + igt_fixture { + drm_intel_bufmgr_destroy(bufmgr); + close(fd); + } }