Skip to content

Commit

Permalink
xen-netfront: fix oops when disconnected from backend
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Vrabel authored and David S. Miller committed Jun 21, 2014
1 parent a705a90 commit 7654186
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/xen-netfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id)

if (likely(netif_carrier_ok(dev) &&
RING_HAS_UNCONSUMED_RESPONSES(&queue->rx)))
napi_schedule(&queue->napi);
napi_schedule(&queue->napi);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -1437,10 +1437,11 @@ static void xennet_end_access(int ref, void *page)
static void xennet_disconnect_backend(struct netfront_info *info)
{
unsigned int i = 0;
struct netfront_queue *queue = NULL;
unsigned int num_queues = info->netdev->real_num_tx_queues;

for (i = 0; i < num_queues; ++i) {
struct netfront_queue *queue = &info->queues[i];

/* Stop old i/f to prevent errors whilst we rebuild the state. */
spin_lock_bh(&queue->rx_lock);
spin_lock_irq(&queue->tx_lock);
Expand Down

0 comments on commit 7654186

Please sign in to comment.