]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: fix off-by-one error in sanity check
authorArnd Bergmann <arnd@arndb.de>
Mon, 27 Sep 2021 13:58:29 +0000 (15:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Sep 2021 12:09:02 +0000 (13:09 +0100)
commit52d440f6c1a5c05aeffd18a2cd0c804d70f98982
tree05dd62ab9fe261cb6ae248c16b3608f8e10fc34a
parent4a65d6101a6eb43ec556c81fc11f91e42736ba80
net: stmmac: fix off-by-one error in sanity check

My previous patch had an off-by-one error in the added sanity
check, the arrays are MTL_MAX_{RX,TX}_QUEUES long, so if that
index is that number, it has overflown.

The patch silenced the warning anyway because the strings could
no longer overlap with the input, but they could still overlap
with other fields.

Fixes: a2ae16b8e18c ("net: stmmac: fix gcc-10 -Wrestrict warning")
Reported-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c