From patchwork Mon Apr 9 21:07:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 10332023 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 C21A86020F for ; Mon, 9 Apr 2018 21:07:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B52961FF87 for ; Mon, 9 Apr 2018 21:07:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A97E02022C; Mon, 9 Apr 2018 21:07:54 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id BA7A81FF87 for ; Mon, 9 Apr 2018 21:07:53 +0000 (UTC) Received: (qmail 3428 invoked by uid 550); 9 Apr 2018 21:07:52 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 3409 invoked from network); 9 Apr 2018 21:07:51 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NpxMcA4s0kNbESxlWiedvYkAALnJZrKIfvWJzlsBvZo=; b=Rj85KrOkXRF35SpnQU8DXZ8BRxG3T5mifGW9v8nPlt1frykxucvPMFQkkjW+O6oiCA VyIhbnEbVqw8Hc3nZN8nmYOujjP7CZ5BmjbQh9c2jcmbyAH6YCqDdLQTArje83gsM3CP +Y+MJunkmJz6v/JkniV03PWxeGanGYB97w2CCofAcPFsv6Q4WxDm7LTepF9mnz/axIcy ZPXwjKHtCWBG3XUpk43HjtksT/4GB6ynJVMX7tr+NMdn9I8OtBpGLGYgzOr8cO3KylCO aj3ZCOgJigcoJn6c6kFbzmJ2ZyExe+hk9vzZQmgL48c/tVRsp7Jh+17RHMSC1jrKdvTW maXg== X-Gm-Message-State: AElRT7Fsl2GcJ78/odcbT0tvFB8U1Pymam68BRp6NlYbSGcP5gjG8EYK a2Kfz2DN41kw4KQ440wB+vFCAA== X-Google-Smtp-Source: AIpwx4/AxJJ57xlXcouxLgY58SJtBMlGKkL4efmvWTEUFLdXBdoHHl8WRnwPlKV+VSrY9i4NWKBL0A== X-Received: by 2002:a17:902:8d96:: with SMTP id v22-v6mr41317094plo.373.1523308059905; Mon, 09 Apr 2018 14:07:39 -0700 (PDT) From: Laura Abbott To: Alex Dubov , Arnd Bergmann , Greg Kroah-Hartman Cc: Laura Abbott , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: [PATCH] misc: tifm: Remove VLA Date: Mon, 9 Apr 2018 14:07:32 -0700 Message-Id: <20180409210732.3919-1-labbott@redhat.com> X-Mailer: git-send-email 2.14.3 X-Virus-Scanned: ClamAV using ClamSMTP There's an ongoing effort to remove VLAs[1] from the kernel to eventually turn on -Wvla. The single VLA can either take a value of 2 or 4 so switch to the upper bound. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Laura Abbott --- drivers/misc/tifm_7xx1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index e5f108713dd8..690eaaea5ce4 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c @@ -239,7 +239,8 @@ static int tifm_7xx1_resume(struct pci_dev *dev) unsigned long timeout; unsigned int good_sockets = 0, bad_sockets = 0; unsigned long flags; - unsigned char new_ids[fm->num_sockets]; + /* Maximum number of entries is 4 */ + unsigned char new_ids[4]; DECLARE_COMPLETION_ONSTACK(finish_resume); pci_set_power_state(dev, PCI_D0);