From b52dfd71f33b902e612b12f6cc89f3b61e4d3e22 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Wed, 27 Jul 2011 14:00:31 +0530 Subject: virtio-net: don't use vdev after virtio_cleanup virtio_cleanup() will be changed by the following patch to remove the VirtIONet struct that gets allocated via virtio_common_init(). Ensure we don't dereference the structure after calling the cleanup function. Signed-off-by: Amit Shah Signed-off-by: Michael S. Tsirkin --- hw/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/virtio-net.c') diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 6997e02dcf..09c665babe 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -1073,6 +1073,6 @@ void virtio_net_exit(VirtIODevice *vdev) qemu_bh_delete(n->tx_bh); } - virtio_cleanup(&n->vdev); qemu_del_vlan_client(&n->nic->nc); + virtio_cleanup(&n->vdev); } -- cgit v1.2.3