On 12/06/2013 05:14 AM, Michael Dalton wrote: > When a packet with invalid length arrives, ensure that the packet > is freed correctly if mergeable packet buffers and big packets > (GUEST_TSO4) are both enabled. > > Signed-off-by: Michael Dalton <mwdal...@google.com> > --- > drivers/net/virtio_net.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 916241d..6a4665c 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -426,10 +426,10 @@ static void receive_buf(struct receive_queue *rq, void > *buf, unsigned int len) > if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) { > pr_debug("%s: short packet %i\n", dev->name, len); > dev->stats.rx_length_errors++; > - if (vi->big_packets) > - give_pages(rq, buf); > - else if (vi->mergeable_rx_bufs) > + if (vi->mergeable_rx_bufs) > put_page(virt_to_head_page(buf)); > + else if (vi->big_packets) > + give_pages(rq, buf); > else > dev_kfree_skb(buf); > return;
Acked-by: Jason Wang <jasow...@redhat.com> _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization