]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-net: correct error handling of virtqueue_kick()
authorJason Wang <jasowang@redhat.com>
Wed, 26 Mar 2014 05:03:00 +0000 (13:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Mar 2014 17:13:21 +0000 (13:13 -0400)
commit99260b6cbc19c22e93a6a990b96dad9b6731048e
treee6c47044894798c2b838e535bbca0d412a4ce3c6
parentf30b4db8f5deca2fdd9510df15af3b9c74117947
virtio-net: correct error handling of virtqueue_kick()

Current error handling of virtqueue_kick() was wrong in two places:
- The skb were freed immediately when virtqueue_kick() fail during
  xmit. This may lead double free since the skb was not detached from
  the virtqueue.
- try_fill_recv() returns false when virtqueue_kick() fail. This will
  lead unnecessary rescheduling of refill work.

Actually, it's safe to just ignore the kick failure in those two
places. So this patch fixes this by partially revert commit
af005b45b1e88f7a4839aba0ba8425ba7e5a51f7.

Fixes af005b45b1e88f7a4839aba0ba8425ba7e5a51f7
(virtio_net: verify if virtqueue_kick() succeeded).

Cc: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-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