lkml.org 
[lkml]   [2023]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net/mlx5e: Replace 0-length array with flexible array
On 05 Jan 14:36, Kees Cook wrote:
>Zero-length arrays are deprecated[1]. Replace struct mlx5e_rx_wqe_cyc's
>"data" 0-length array with a flexible array. Detected with GCC 13,
>using -fstrict-flex-arrays=3:
>
>drivers/net/ethernet/mellanox/mlx5/core/en_main.c: In function 'mlx5e_alloc_rq':
>drivers/net/ethernet/mellanox/mlx5/core/en_main.c:827:42: warning: array subscript f is outside array bounds of 'struct mlx5_wqe_data_seg[0]' [-Warray-bounds=]
> 827 | wqe->data[f].byte_count = 0;
> | ~~~~~~~~~^~~
>In file included from drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h:11,
> from drivers/net/ethernet/mellanox/mlx5/core/eswitch.h:48,
> from drivers/net/ethernet/mellanox/mlx5/core/en_main.c:42:
>drivers/net/ethernet/mellanox/mlx5/core/en.h:250:39: note: while referencing 'data'
> 250 | struct mlx5_wqe_data_seg data[0];
> | ^~~~
>
>[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
>
>Cc: Saeed Mahameed <saeedm@nvidia.com>
>Cc: Leon Romanovsky <leon@kernel.org>
>Cc: "David S. Miller" <davem@davemloft.net>
>Cc: Eric Dumazet <edumazet@google.com>
>Cc: Jakub Kicinski <kuba@kernel.org>
>Cc: Paolo Abeni <pabeni@redhat.com>
>Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
>Cc: netdev@vger.kernel.org
>Cc: linux-rdma@vger.kernel.org
>Signed-off-by: Kees Cook <keescook@chromium.org>

Applied to net-next-mlx5, Thanks!

\
 
 \ /
  Last update: 2023-03-26 23:35    [W:0.194 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site