aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2014-04-12 05:55:40 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-12 16:49:06 -0400
commit810d8cedcc880dca8b64e05fe1331ab5d4f8d992 (patch)
tree0c67703de5b8dde209e5bee3a54cbe76ca30c1bd /drivers/net/xen-netfront.c
parentdcfba949ba4ff90f5a7ff2942a4c86f9e2ba345d (diff)
drivers: net: xen-netfront: fix array initialization bug
This patch fixes the initialization of an array used in the TX datapath that was mistakenly initialized together with the RX datapath arrays. An out of range array access could happen when RX and TX rings had different sizes. Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 057b05700f8b..158b5e639fc7 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1291,13 +1291,13 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
1291 for (i = 0; i < NET_TX_RING_SIZE; i++) { 1291 for (i = 0; i < NET_TX_RING_SIZE; i++) {
1292 skb_entry_set_link(&np->tx_skbs[i], i+1); 1292 skb_entry_set_link(&np->tx_skbs[i], i+1);
1293 np->grant_tx_ref[i] = GRANT_INVALID_REF; 1293 np->grant_tx_ref[i] = GRANT_INVALID_REF;
1294 np->grant_tx_page[i] = NULL;
1294 } 1295 }
1295 1296
1296 /* Clear out rx_skbs */ 1297 /* Clear out rx_skbs */
1297 for (i = 0; i < NET_RX_RING_SIZE; i++) { 1298 for (i = 0; i < NET_RX_RING_SIZE; i++) {
1298 np->rx_skbs[i] = NULL; 1299 np->rx_skbs[i] = NULL;
1299 np->grant_rx_ref[i] = GRANT_INVALID_REF; 1300 np->grant_rx_ref[i] = GRANT_INVALID_REF;
1300 np->grant_tx_page[i] = NULL;
1301 } 1301 }
1302 1302
1303 /* A grant for every tx ring slot */ 1303 /* A grant for every tx ring slot */