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>
This commit is contained in:
Michael S. Tsirkin 2010-10-27 20:03:43 +02:00 committed by Anthony Liguori
parent 788954270d
commit 43849424cf
1 changed files with 1 additions and 0 deletions

View File

@ -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);