Received: by 10.223.185.116 with SMTP id b49csp6579995wrg; Thu, 8 Mar 2018 09:41:45 -0800 (PST) X-Google-Smtp-Source: AG47ELtn1rDn6OSPgGX4xobkYm7XLznL14R7bQvuZBvmA3Xq3KkgX+zz9gEfqlXqawSBsV3oFAOn X-Received: by 10.101.100.200 with SMTP id t8mr22241562pgv.120.1520530905346; Thu, 08 Mar 2018 09:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520530905; cv=none; d=google.com; s=arc-20160816; b=pxGDFf8bY6EThWfLZAIWoHTAR1llawouThYYU47Mo2R3x66IcMdFTp+KRQj8xsqo/I 1w8nfpVZeMqJUJoLuzCXKssDNy6dfxcSYp4nbGWrzuz3mCmK18zNeuMkha1tMJ17OOu+ u6N1MByRVy2wbLrjbqXSPbCmrqCe3w8MKilAhoMF1s7jWJvkLXXT0szD00n/myhY7o4Q ZhMXbpIqmSCEDQkF1VCfiT5PKskb2QfIQANkLQNbVbA01Z48xKeyl8oI553GDJYXPRhX Fh350+zgRoWpadCahbN7yAAIH+I1CpWIx29WMJX7dqPweWEV58Vhf6VqNhHZHkELKuOx RtgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=LU4xsTD12xsveo4/emd62BmocZr7AyEOGft0XrWl5MA=; b=Zgm3g6Mkox7RAjaBtiy2L0p7WphGwpQkFNq1405F7pqlkiZAMupZZYbAIiLJT6dLQh b1pIx/EdaAAqpOEwcC86BxiUYj39hY5ZzMhTfbEgw8IaDZHjKZGeDLw1JvR4d4zoLzja 7Lirumw49wiH84T8VqWse+aataKEoG9GbCdwrOZIzFYIp7IiSky2bvuOVjbnBuRX1JQO vv5LIZokqin9VD4xhjw2CWYCmXbY+y3mgl+WzOZQbqArUSIZJkc8dp4oR6s0+g5WPEf2 BJZEPbfItB3jSGhFHr7W5tyBi2iLlyMlyxwJ7SmlYxJckVDsu3yKa/r1SgaC3Wcd0vrH RCMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12-v6si15303839plo.798.2018.03.08.09.41.17; Thu, 08 Mar 2018 09:41:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936065AbeCHRjw (ORCPT + 99 others); Thu, 8 Mar 2018 12:39:52 -0500 Received: from gateway21.websitewelcome.com ([192.185.45.159]:22648 "EHLO gateway21.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933407AbeCHRju (ORCPT ); Thu, 8 Mar 2018 12:39:50 -0500 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 245E7400F386C for ; Thu, 8 Mar 2018 11:39:50 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id tzWAeFT9Xz11gtzWAet0eR; Thu, 08 Mar 2018 11:39:50 -0600 Received: from [189.175.117.58] (port=58548 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1etzW9-002E5U-Hn; Thu, 08 Mar 2018 11:39:49 -0600 Date: Thu, 8 Mar 2018 11:39:49 -0600 From: "Gustavo A. R. Silva" To: Emil Velikov , Florian Tobias Schandinat , Bartlomiej Zolnierkiewicz Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Kees Cook , "Gustavo A. R. Silva" Subject: [PATCH] video: fbdev: via: remove VLA usage Message-ID: <20180308173949.GA19305@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.117.58 X-Source-L: No X-Exim-ID: 1etzW9-002E5U-Hn X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.117.58]:58548 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 29 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to enabling -Wvla, remove VLA usage. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/via/via_aux_sii164.c | 2 +- drivers/video/fbdev/via/via_aux_vt1631.c | 2 +- drivers/video/fbdev/via/via_aux_vt1632.c | 2 +- drivers/video/fbdev/via/via_aux_vt1636.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/via/via_aux_sii164.c b/drivers/video/fbdev/via/via_aux_sii164.c index ca1b35f..c27f62c 100644 --- a/drivers/video/fbdev/via/via_aux_sii164.c +++ b/drivers/video/fbdev/via/via_aux_sii164.c @@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x01, 0x00, 0x06, 0x00}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return; diff --git a/drivers/video/fbdev/via/via_aux_vt1631.c b/drivers/video/fbdev/via/via_aux_vt1631.c index 06e742f..32978a0 100644 --- a/drivers/video/fbdev/via/via_aux_vt1631.c +++ b/drivers/video/fbdev/via/via_aux_vt1631.c @@ -36,7 +36,7 @@ void via_aux_vt1631_probe(struct via_aux_bus *bus) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x06, 0x11, 0x91, 0x31}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return; diff --git a/drivers/video/fbdev/via/via_aux_vt1632.c b/drivers/video/fbdev/via/via_aux_vt1632.c index d24f4cd..cec8cc4 100644 --- a/drivers/video/fbdev/via/via_aux_vt1632.c +++ b/drivers/video/fbdev/via/via_aux_vt1632.c @@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return; diff --git a/drivers/video/fbdev/via/via_aux_vt1636.c b/drivers/video/fbdev/via/via_aux_vt1636.c index 9e015c1..2b10bc2 100644 --- a/drivers/video/fbdev/via/via_aux_vt1636.c +++ b/drivers/video/fbdev/via/via_aux_vt1636.c @@ -36,7 +36,7 @@ void via_aux_vt1636_probe(struct via_aux_bus *bus) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return; -- 2.7.4