Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76541869 authored by David Vrabel's avatar David Vrabel Committed by David S. Miller
Browse files

xen-netfront: fix oops when disconnected from backend



xennet_disconnect_backend() was not correctly iterating over all the
queues.

Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Reviewed-by: default avatarWei Liu <wei.liu2@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a705a906
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1437,10 +1437,11 @@ static void xennet_end_access(int ref, void *page)
static void xennet_disconnect_backend(struct netfront_info *info)
static void xennet_disconnect_backend(struct netfront_info *info)
{
{
	unsigned int i = 0;
	unsigned int i = 0;
	struct netfront_queue *queue = NULL;
	unsigned int num_queues = info->netdev->real_num_tx_queues;
	unsigned int num_queues = info->netdev->real_num_tx_queues;


	for (i = 0; i < num_queues; ++i) {
	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. */
		/* Stop old i/f to prevent errors whilst we rebuild the state. */
		spin_lock_bh(&queue->rx_lock);
		spin_lock_bh(&queue->rx_lock);
		spin_lock_irq(&queue->tx_lock);
		spin_lock_irq(&queue->tx_lock);