[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200511123352.D753CC43637@smtp.codeaurora.org>
Date: Mon, 11 May 2020 12:33:52 +0000 (UTC)
From: Kalle Valo <kvalo@...eaurora.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Maya Erez <merez@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Arnd Bergmann <arnd@...db.de>,
Dedy Lansky <dlansky@...eaurora.org>,
Ahmad Masri <amasri@...eaurora.org>,
Alexei Avshalom Lazar <ailizaro@...eaurora.org>,
Tzahi Sabo <stzahi@...eaurora.org>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Lior David <liord@...eaurora.org>,
linux-wireless@...r.kernel.org, wil6210@....qualcomm.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] wil6210: avoid gcc-10 zero-length-bounds warning
Arnd Bergmann <arnd@...db.de> wrote:
> gcc-10 warns about accesses inside of a zero-length array:
>
> drivers/net/wireless/ath/wil6210/cfg80211.c: In function 'wil_cfg80211_scan':
> drivers/net/wireless/ath/wil6210/cfg80211.c:970:23: error: array subscript 255 is outside the bounds of an interior zero-length array 'struct <anonymous>[0]' [-Werror=zero-length-bounds]
> 970 | cmd.cmd.channel_list[cmd.cmd.num_channels++].channel = ch - 1;
> | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/net/wireless/ath/wil6210/wil6210.h:17,
> from drivers/net/wireless/ath/wil6210/cfg80211.c:11:
> drivers/net/wireless/ath/wil6210/wmi.h:477:4: note: while referencing 'channel_list'
> 477 | } channel_list[0];
> | ^~~~~~~~~~~~
>
> Turn this into a flexible array to avoid the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Kalle Valo <kvalo@...eaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
04a4d3416372 wil6210: avoid gcc-10 zero-length-bounds warning
--
https://patchwork.kernel.org/patch/11529309/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists