Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[netdrvr] fix array overflows in Chelsio driver

Adrian Bunk wrote:
> The Coverity checker spotted the following two array overflows in
> drivers/net/chelsio/sge.c (in both cases, the arrays contain 3
> elements):
[snip]

This is a bug. The array should contain 2 elements. Here is the fix.

Signed-off-by: Scott Bardone <sbardone@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Scott Bardone and committed by
Jeff Garzik
232a347a c3d7a3a4

+3 -3
+3 -3
drivers/net/chelsio/sge.c
··· 1021 1021 if (test_and_clear_bit(nd->if_port, 1022 1022 &sge->stopped_tx_queues) && 1023 1023 netif_running(nd)) { 1024 - sge->stats.cmdQ_restarted[3]++; 1024 + sge->stats.cmdQ_restarted[2]++; 1025 1025 netif_wake_queue(nd); 1026 1026 } 1027 1027 } ··· 1350 1350 if (unlikely(credits < count)) { 1351 1351 netif_stop_queue(dev); 1352 1352 set_bit(dev->if_port, &sge->stopped_tx_queues); 1353 - sge->stats.cmdQ_full[3]++; 1353 + sge->stats.cmdQ_full[2]++; 1354 1354 spin_unlock(&q->lock); 1355 1355 if (!netif_queue_stopped(dev)) 1356 1356 CH_ERR("%s: Tx ring full while queue awake!\n", ··· 1358 1358 return NETDEV_TX_BUSY; 1359 1359 } 1360 1360 if (unlikely(credits - count < q->stop_thres)) { 1361 - sge->stats.cmdQ_full[3]++; 1361 + sge->stats.cmdQ_full[2]++; 1362 1362 netif_stop_queue(dev); 1363 1363 set_bit(dev->if_port, &sge->stopped_tx_queues); 1364 1364 }