gve: Fix off by one in gve_tx_timeout()
[ Upstream commit1c360cc1cc] The priv->ntfy_blocks[] has "priv->num_ntfy_blks" elements so this > needs to be >= to prevent an off by one bug. The priv->ntfy_blocks[] array is allocated in gve_alloc_notify_blocks(). Fixes:87a7f321bb("gve: Recover from queue stall due to missed IRQ") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c842a4c4ae
commit
4af0cd17e7
1 changed files with 1 additions and 1 deletions
|
|
@ -959,7 +959,7 @@ static void gve_tx_timeout(struct net_device *dev, unsigned int txqueue)
|
|||
goto reset;
|
||||
|
||||
ntfy_idx = gve_tx_idx_to_ntfy(priv, txqueue);
|
||||
if (ntfy_idx > priv->num_ntfy_blks)
|
||||
if (ntfy_idx >= priv->num_ntfy_blks)
|
||||
goto reset;
|
||||
|
||||
block = &priv->ntfy_blocks[ntfy_idx];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue