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)
commit681daee2443291419c57cccb0671f5f94a839005
treee6c47044894798c2b838e535bbca0d412a4ce3c6
parentde1443916791d75fdd26becb116898277bb0273f
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
67975901183799af8e93ec60e322f9e2a1940b9b.

Fixes 67975901183799af8e93ec60e322f9e2a1940b9b
(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