]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gve: Fix off by one in gve_tx_timeout()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 9 Nov 2021 11:47:36 +0000 (14:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 10:04:43 +0000 (11:04 +0100)
commite8cf4c96f11ed1fe21f106e0d75b776c2b4cf543
tree78b277eddae5ed1cc0c2a21745c8199f481dce18
parentcf427bf68f29d9c71624a4505b5d622a96c95fb4
gve: Fix off by one in gve_tx_timeout()

[ Upstream commit 1c360cc1cc883fbdf0a258b4df376571fbeac5ee ]

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: 87a7f321bb6a ("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>
drivers/net/ethernet/google/gve/gve_main.c