]> git.proxmox.com Git - mirror_qemu.git/commit
virtio-net: fix wild pointer when remove virtio-net queues
authorYunjian Wang <wangyunjian@huawei.com>
Wed, 26 Apr 2017 06:45:56 +0000 (14:45 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Aug 2017 19:52:02 +0000 (14:52 -0500)
commit0b185544c98671373a7ea9f2abc1de50a498a722
tree74c483ba77f75a46a96f841dff8b6c6746ff68e5
parentf3676379cc9f2c803e5e35e1fb7e0ae2041f6f1a
virtio-net: fix wild pointer when remove virtio-net queues

The tx_bh or tx_timer will free in virtio_net_del_queue() function, when
removing virtio-net queues if the guest doesn't support multiqueue. But
it might be still referenced by virtio_net_set_status(), which needs to
be set NULL. And also the tx_waiting needs to be set zero to prevent
virtio_net_set_status() accessing tx_bh or tx_timer.

Cc: qemu-stable@nongnu.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit f989c30cf834ba8625e98b808eac30e4e7ec5008)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/net/virtio-net.c