From 812efdc3b106ac41639616c1a8b9dd9e914f84c0 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Fri, 5 Aug 2011 04:55:06 -0300 Subject: [RHEL6 qemu-kvm PATCH 60/65] virtio-net: don't use vdev after virtio_cleanup RH-Author: Amit Shah Message-id: Patchwork-id: 30983 O-Subject: [RHEL6.2 qemu-kvm PATCH 2/3] virtio-net: don't use vdev after virtio_cleanup Bugzilla: 726020 RH-Acked-by: Markus Armbruster RH-Acked-by: Jes Sorensen RH-Acked-by: Kevin Wolf 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 (cherry picked from commit b52dfd71f33b902e612b12f6cc89f3b61e4d3e22) Bugzilla: 726020 Signed-off-by: Amit Shah --- hw/virtio-net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Signed-off-by: Eduardo Habkost --- hw/virtio-net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 72d37f8..0b03b57 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -1036,6 +1036,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); } -- 1.7.3.2