Re: [PATCH] tg3: fix array subscript out of bounds compilation error

From: Carlos Bilbao
Date: Fri Jul 21 2023 - 18:45:09 EST


On 7/18/23 9:54 PM, Jakub Kicinski wrote:
> On Tue, 18 Jul 2023 10:52:39 -0500 Carlos Bilbao wrote:
>>>> Fix encountered compilation error in tg3.c where an array subscript was
>>>
>>> What is the error ?
>>
>> drivers/net/ethernet/broadcom/tg3.c: In function ‘tg3_init_one’:
>
> What compiler are you using? Any extra flags?

GCC version 13.1.1. No special flags.

>
> I remember seeing this warning too, but I can't repro it now (gcc 13.1;
> clang 16).
>
>>>> above the array bounds of 'struct tg3_napi[5]'. Add an additional check in
>>>> the for loop to ensure that it does not exceed the bounds of
>>>> 'struct tg3_napi' (defined by TG3_IRQ_MAX_VECS).
>>>>
>>>> Reviewed-By: Carlos Bilbao <carlos.bilbao@xxxxxxx>
>
> We need a sign-off tag

Apologies, Signed-off-By: Carlos Bilbao <carlos.bilbao@xxxxxxx>

Thanks,
Carlos