summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-10-27 20:03:43 +0200
committerMichael S. Tsirkin <mst@redhat.com>2010-11-04 15:10:03 +0200
commit54cdaa1bad3885448ef39faad93d40be3b223519 (patch)
treefe57c8065c292b73e7dcd9008423d515fb973cbf
parent5fc9cfedfa09199e10b5f9b67dcd286bfeae4f7a (diff)
downloadhqemu-54cdaa1bad3885448ef39faad93d40be3b223519.zip
hqemu-54cdaa1bad3885448ef39faad93d40be3b223519.tar.gz
tap: clear vhost_net backend on cleanup
Frontends calling tap_get_vhost_net get an invalid pointer after the peer backend has been deleted. Jason Wang <jasowang@redhat.com> reports this leading to a crash in ack_features when we remove the vhost-net bakend of a virtio nic. The fix is simply to clear the backend pointer. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--net/tap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tap.c b/net/tap.c
index 4afb314..937d942 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -279,6 +279,7 @@ static void tap_cleanup(VLANClientState *nc)
if (s->vhost_net) {
vhost_net_cleanup(s->vhost_net);
+ s->vhost_net = NULL;
}
qemu_purge_queued_packets(nc);
OpenPOWER on IntegriCloud