OSDN Git Service

virtio-net: fix leaking page for gso packet during mergeable XDP
authorJason Wang <jasowang@redhat.com>
Tue, 22 May 2018 03:44:31 +0000 (11:44 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 May 2018 17:36:19 +0000 (13:36 -0400)
commit3d62b2a0db505bbf9ed0755f254e45d775f9807f
treeb3483469c110e3f8256b77efc2e66c2a5be1c6c3
parent850e088d5bbb333342fd4def08d0a4035f2b7126
virtio-net: fix leaking page for gso packet during mergeable XDP

We need to drop refcnt to xdp_page if we see a gso packet. Otherwise
it will be leaked. Fixing this by moving the check of gso packet above
the linearizing logic. While at it, remove useless comment as well.

Cc: John Fastabend <john.fastabend@gmail.com>
Fixes: 72979a6c3590 ("virtio_net: xdp, add slowpath case for non contiguous buffers")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c