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

Commit 9a873c71 authored by Chas Williams's avatar Chas Williams Committed by David S. Miller
Browse files

net/xen-netfront: only clean up queues if present



If you simply load and unload the module without starting the interfaces,
the queues are never created and you get a bad pointer dereference.

Signed-off-by: default avatarChas Williams <3chas3@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f5117ce4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1336,7 +1336,7 @@ static void xennet_disconnect_backend(struct netfront_info *info)

	netif_carrier_off(info->netdev);

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

		if (queue->tx_irq && (queue->tx_irq == queue->rx_irq))
@@ -2101,6 +2101,7 @@ static int xennet_remove(struct xenbus_device *dev)

	unregister_netdev(info->netdev);

	if (info->queues)
		xennet_destroy_queues(info);
	xennet_free_netdev(info->netdev);