]> 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)
commitbe5acd43f6dda2b6b348b12930395bd14406bf2b
treee6c47044894798c2b838e535bbca0d412a4ce3c6
parent1e652bfc0326732a0d7fc5acad772a04165ce0b6
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
019bd31beeeb8ec8d205d894e5ac1f08960f97a6.

Fixes 019bd31beeeb8ec8d205d894e5ac1f08960f97a6
(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