Thread (4 messages) flat view 4 messages, 3 authors, 2021-09-27

Re: [PATCH] [RESEND] net: stmmac: fix gcc-10 -Wrestrict warning

From: Arnd Bergmann <arnd@kernel.org>
Date: 2021-09-27 13:59:49
Also in: linux-arm-kernel, lkml

On Mon, Sep 27, 2021 at 3:27 PM Russell King (Oracle)
[off-list ref] wrote:
On Mon, Sep 27, 2021 at 12:02:44PM +0200, Arnd Bergmann wrote:

This looks rather weird. rx_irq[] is defined as:

        int rx_irq[MTL_MAX_RX_QUEUES];

If "i" were to become MTL_MAX_RX_QUEUES, then the above code overlows
the array.

So while this may stop gcc-10 complaining, I'd argue that making the
new test ">=" rather than ">" would have also made it look correct.
Indeed, thanks for pointing this out. I have sent a follow-up with
that change now.

             Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help