virtio-net: only delete bh that existed
commit6b9b8758c15f3bc2875dbd6e2d03c5362b8d6902
authorJason Wang <jasowang@redhat.com>
Wed, 6 Nov 2013 08:58:08 +0000 (6 16:58 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 10 Nov 2013 10:08:38 +0000 (10 12:08 +0200)
tree41a42ff79dbb27aed1d5b91a9e6be3a6ecae5081
parent04c7d8b8dea724f1007f0f6e76047ff03b4cb24f
virtio-net: only delete bh that existed

We delete without check whether it existed during exit. This will lead NULL
pointer deference since it was created conditionally depends on guest driver
status and features. So add a check of existence before trying to delete it.

Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/virtio-net.c