From patchwork Fri Oct 30 15:58:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 7527911 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 1E4FEBEEA4 for ; Fri, 30 Oct 2015 15:58:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57E50207BB for ; Fri, 30 Oct 2015 15:58:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 90F57207B9 for ; Fri, 30 Oct 2015 15:58:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 54A646ECE3; Fri, 30 Oct 2015 08:58:34 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 90E686ECE4 for ; Fri, 30 Oct 2015 08:58:31 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 30 Oct 2015 08:58:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,219,1444719600"; d="scan'208";a="591097875" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.50]) by FMSMGA003.fm.intel.com with ESMTP; 30 Oct 2015 08:58:30 -0700 Received: by rosetta (Postfix, from userid 1000) id A496081941; Fri, 30 Oct 2015 17:58:37 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Fri, 30 Oct 2015 17:58:33 +0200 Message-Id: <1446220713-585-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 2.5.0 Cc: Thomas Wood Subject: [Intel-gfx] [PATCH] tests/drv_hangman: Fix uninitialized tail usage 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=-5.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 Tail needs to be in outer scope as it is used after loop continuation destroying its scope. Reported-by: Thomas Wood Cc: Thomas Wood Signed-off-by: Mika Kuoppala --- tests/drv_hangman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c index 6caf910..280f903 100644 --- a/tests/drv_hangman.c +++ b/tests/drv_hangman.c @@ -240,6 +240,7 @@ static void check_error_state(const int gen, size_t line_size = 0; char *ring_name = NULL; bool bb_ok = false, req_ok = false, ringbuf_ok = false; + uint32_t tail; debug_fd = igt_debugfs_open("i915_error_state", O_RDONLY); igt_assert_lte(0, debug_fd); @@ -252,7 +253,6 @@ static void check_error_state(const int gen, uint64_t gtt_offset; int req_matched = 0; int requests; - uint32_t tail; int ringbuf_matched = 0; int i, items;