From c0b87e7d4778c176c119f1e129f241b9a93eae81 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Wed, 26 Aug 2009 14:58:28 +0530 Subject: [PATCH] --- yaml --- r: 166352 b: refs/heads/master c: 0aea51c37fc5868cd723f670af9056c2ef694fee h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/virtio_net.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index a969d3bb3cc4..cb6cd7bb939e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 48925e372f04f5e35fec6269127c62b2c71ab794 +refs/heads/master: 0aea51c37fc5868cd723f670af9056c2ef694fee diff --git a/trunk/drivers/net/virtio_net.c b/trunk/drivers/net/virtio_net.c index effe8c685f77..d445845f2779 100644 --- a/trunk/drivers/net/virtio_net.c +++ b/trunk/drivers/net/virtio_net.c @@ -280,7 +280,7 @@ static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp) bool oom = false; sg_init_table(sg, 2+MAX_SKB_FRAGS); - for (;;) { + do { struct skb_vnet_hdr *hdr; skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN); @@ -323,7 +323,7 @@ static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp) break; } vi->num++; - } + } while (err >= num); if (unlikely(vi->num > vi->max)) vi->max = vi->num; vi->rvq->vq_ops->kick(vi->rvq); @@ -341,7 +341,7 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) if (!vi->mergeable_rx_bufs) return try_fill_recv_maxbufs(vi, gfp); - for (;;) { + do { skb_frag_t *f; skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN); @@ -375,7 +375,7 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) break; } vi->num++; - } + } while (err > 0); if (unlikely(vi->num > vi->max)) vi->max = vi->num; vi->rvq->vq_ops->kick(vi->rvq);