diff options
author | David Vrabel <david.vrabel@citrix.com> | 2014-06-18 05:47:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-21 19:14:26 -0400 |
commit | 765418694bc99d91e71ede6d2889a6328da137fe (patch) | |
tree | 379f7e2a8c59940934396ef059f72417d254072d | |
parent | a705a906c617b1c389729829c0a160f179d043bf (diff) |
xen-netfront: fix oops when disconnected from backend
xennet_disconnect_backend() was not correctly iterating over all the
queues.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/xen-netfront.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 5a7872ac3566..daaf1e56e41e 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1287,7 +1287,7 @@ static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id) | |||
1287 | 1287 | ||
1288 | if (likely(netif_carrier_ok(dev) && | 1288 | if (likely(netif_carrier_ok(dev) && |
1289 | RING_HAS_UNCONSUMED_RESPONSES(&queue->rx))) | 1289 | RING_HAS_UNCONSUMED_RESPONSES(&queue->rx))) |
1290 | napi_schedule(&queue->napi); | 1290 | napi_schedule(&queue->napi); |
1291 | 1291 | ||
1292 | return IRQ_HANDLED; | 1292 | return IRQ_HANDLED; |
1293 | } | 1293 | } |
@@ -1437,10 +1437,11 @@ static void xennet_end_access(int ref, void *page) | |||
1437 | static void xennet_disconnect_backend(struct netfront_info *info) | 1437 | static void xennet_disconnect_backend(struct netfront_info *info) |
1438 | { | 1438 | { |
1439 | unsigned int i = 0; | 1439 | unsigned int i = 0; |
1440 | struct netfront_queue *queue = NULL; | ||
1441 | unsigned int num_queues = info->netdev->real_num_tx_queues; | 1440 | unsigned int num_queues = info->netdev->real_num_tx_queues; |
1442 | 1441 | ||
1443 | for (i = 0; i < num_queues; ++i) { | 1442 | for (i = 0; i < num_queues; ++i) { |
1443 | struct netfront_queue *queue = &info->queues[i]; | ||
1444 | |||
1444 | /* Stop old i/f to prevent errors whilst we rebuild the state. */ | 1445 | /* Stop old i/f to prevent errors whilst we rebuild the state. */ |
1445 | spin_lock_bh(&queue->rx_lock); | 1446 | spin_lock_bh(&queue->rx_lock); |
1446 | spin_lock_irq(&queue->tx_lock); | 1447 | spin_lock_irq(&queue->tx_lock); |