From patchwork Fri Feb 17 15:26:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Starkey X-Patchwork-Id: 9580137 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 AAA32600F6 for ; Fri, 17 Feb 2017 15:27:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB9D269A3 for ; Fri, 17 Feb 2017 15:27:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F41F2843A; Fri, 17 Feb 2017 15:27:03 +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 1785B269A3 for ; Fri, 17 Feb 2017 15:27:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42FD489873; Fri, 17 Feb 2017 15:27:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by gabe.freedesktop.org (Postfix) with ESMTP id 2877189873 for ; Fri, 17 Feb 2017 15:27:01 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D935F344; Fri, 17 Feb 2017 07:27:00 -0800 (PST) Received: from e106950-lin.cambridge.arm.com (e106950-lin.cambridge.arm.com [10.2.133.193]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 68E063F2E5; Fri, 17 Feb 2017 07:27:00 -0800 (PST) From: Brian Starkey To: intel-gfx@lists.freedesktop.org Date: Fri, 17 Feb 2017 15:26:54 +0000 Message-Id: <1487345214-21875-1-git-send-email-brian.starkey@arm.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Intel-gfx] [PATCH i-g-t] kms_atomic_transition: Initialize pipe_crcs to avoid segfault 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-Virus-Scanned: ClamAV using ClamSMTP igt_pipe_crc_new() is skipped for non-Intel devices, but the later calls to collect_crcs_mask() will attempt to retrieve CRC values if the pipe_crcs pointers are non-NULL. Zero-initialise pipe_crcs to avoid accessing garbage pointers on non-Intel devices. Signed-off-by: Brian Starkey Reviewed-by: Petri Latvala --- tests/kms_atomic_transition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c index ba8c8b5ca02b..1599f0b36c4e 100644 --- a/tests/kms_atomic_transition.c +++ b/tests/kms_atomic_transition.c @@ -608,7 +608,7 @@ static void run_modeset_tests(igt_display_t *display, int howmany, bool nonblock struct igt_fb fbs[2]; int i, j; unsigned iter_max = 1 << display->n_pipes; - igt_pipe_crc_t *pipe_crcs[I915_MAX_PIPES]; + igt_pipe_crc_t *pipe_crcs[I915_MAX_PIPES] = { 0 }; igt_output_t *output; unsigned width = 0, height = 0; bool skip_test = false;