From: Michael S. Tsirkin Date: Wed, 27 Oct 2010 18:03:43 +0000 (+0200) Subject: tap: clear vhost_net backend on cleanup X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1405^2~17^2~3281^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54cdaa1bad3885448ef39faad93d40be3b223519;p=sdk%2Femulator%2Fqemu.git 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 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 --- diff --git a/net/tap.c b/net/tap.c index 4afb314fde..937d9429eb 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);