diff options
| -rw-r--r-- | drivers/net/virtio_net.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index effe8c685f77..d445845f2779 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
| @@ -280,7 +280,7 @@ static bool try_fill_recv_maxbufs(struct virtnet_info *vi, gfp_t gfp) | |||
| 280 | bool oom = false; | 280 | bool oom = false; |
| 281 | 281 | ||
| 282 | sg_init_table(sg, 2+MAX_SKB_FRAGS); | 282 | sg_init_table(sg, 2+MAX_SKB_FRAGS); |
| 283 | for (;;) { | 283 | do { |
| 284 | struct skb_vnet_hdr *hdr; | 284 | struct skb_vnet_hdr *hdr; |
| 285 | 285 | ||
| 286 | skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN); | 286 | 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) | |||
| 323 | break; | 323 | break; |
| 324 | } | 324 | } |
| 325 | vi->num++; | 325 | vi->num++; |
| 326 | } | 326 | } while (err >= num); |
| 327 | if (unlikely(vi->num > vi->max)) | 327 | if (unlikely(vi->num > vi->max)) |
| 328 | vi->max = vi->num; | 328 | vi->max = vi->num; |
| 329 | vi->rvq->vq_ops->kick(vi->rvq); | 329 | vi->rvq->vq_ops->kick(vi->rvq); |
| @@ -341,7 +341,7 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp) | |||
| 341 | if (!vi->mergeable_rx_bufs) | 341 | if (!vi->mergeable_rx_bufs) |
| 342 | return try_fill_recv_maxbufs(vi, gfp); | 342 | return try_fill_recv_maxbufs(vi, gfp); |
| 343 | 343 | ||
| 344 | for (;;) { | 344 | do { |
| 345 | skb_frag_t *f; | 345 | skb_frag_t *f; |
| 346 | 346 | ||
| 347 | skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN); | 347 | 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) | |||
| 375 | break; | 375 | break; |
| 376 | } | 376 | } |
| 377 | vi->num++; | 377 | vi->num++; |
| 378 | } | 378 | } while (err > 0); |
| 379 | if (unlikely(vi->num > vi->max)) | 379 | if (unlikely(vi->num > vi->max)) |
| 380 | vi->max = vi->num; | 380 | vi->max = vi->num; |
| 381 | vi->rvq->vq_ops->kick(vi->rvq); | 381 | vi->rvq->vq_ops->kick(vi->rvq); |
