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>

authored by Vincenzo Maffione and committed by David S. Miller 810d8ced dcfba949

+1 -1
+1 -1
drivers/net/xen-netfront.c
··· 1291 for (i = 0; i < NET_TX_RING_SIZE; i++) { 1292 skb_entry_set_link(&np->tx_skbs[i], i+1); 1293 np->grant_tx_ref[i] = GRANT_INVALID_REF; 1294 } 1295 1296 /* Clear out rx_skbs */ 1297 for (i = 0; i < NET_RX_RING_SIZE; i++) { 1298 np->rx_skbs[i] = NULL; 1299 np->grant_rx_ref[i] = GRANT_INVALID_REF; 1300 - np->grant_tx_page[i] = NULL; 1301 } 1302 1303 /* A grant for every tx ring slot */
··· 1291 for (i = 0; i < NET_TX_RING_SIZE; i++) { 1292 skb_entry_set_link(&np->tx_skbs[i], i+1); 1293 np->grant_tx_ref[i] = GRANT_INVALID_REF; 1294 + np->grant_tx_page[i] = NULL; 1295 } 1296 1297 /* Clear out rx_skbs */ 1298 for (i = 0; i < NET_RX_RING_SIZE; i++) { 1299 np->rx_skbs[i] = NULL; 1300 np->grant_rx_ref[i] = GRANT_INVALID_REF; 1301 } 1302 1303 /* A grant for every tx ring slot */