提交 5326636f 编写于 作者: J Jason Wang 提交者: Michael Roth

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: NJason Wang <jasowang@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Message-id: 1383728288-28469-1-git-send-email-jasowang@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@amazon.com>
(cherry picked from commit fe2dafa0)

Conflicts:

	hw/net/virtio-net.c

*modified to reflect timer function names for 1.6
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 3bd74d17
......@@ -1600,7 +1600,7 @@ static int virtio_net_device_exit(DeviceState *qdev)
if (q->tx_timer) {
qemu_del_timer(q->tx_timer);
qemu_free_timer(q->tx_timer);
} else {
} else if (q->tx_bh) {
qemu_bh_delete(q->tx_bh);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册