virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv
authorwangyunjian <wangyunjian@huawei.com>
Tue, 31 May 2016 03:52:43 +0000 (11:52 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 May 2016 21:21:09 +0000 (14:21 -0700)
commitf00e35e259948b995aa1f3ee7fddb05f34a50157
treee25a6eb51a1b3b1b2c5ff48810b4609c6deee507
parentbae5499cc55d2329ea0fbf09cb22298f4ca2f9bd
virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv

In function virtnet_open() and virtnet_probe(), func try_fill_recv() may
be executed at the same time. VQ in virtqueue_add() has not been protected
well and BUG_ON will be triggered when virito_net.ko being removed.

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c