Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201198
b: refs/heads/master
c: 1fe9b6f
h: refs/heads/master
v: v3
  • Loading branch information
Michael S. Tsirkin authored and Linus Torvalds committed Jul 26, 2010
1 parent e32698d commit ae90857
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e65a2075cc740b485ab203430bdf3459d5551b6
refs/heads/master: 1fe9b6fef11771461e69ecd1bc8935a1c7c90cb5
5 changes: 3 additions & 2 deletions trunk/drivers/virtio/virtio_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq,
gfp_t gfp)
{
struct vring_virtqueue *vq = to_vvq(_vq);
unsigned int i, avail, head, uninitialized_var(prev);
unsigned int i, avail, uninitialized_var(prev);
int head;

START_USE(vq);

Expand All @@ -174,7 +175,7 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq,
* buffers, then go indirect. FIXME: tune this threshold */
if (vq->indirect && (out + in) > 1 && vq->num_free) {
head = vring_add_indirect(vq, sg, out, in, gfp);
if (head != vq->vring.num)
if (likely(head >= 0))
goto add_head;
}

Expand Down

0 comments on commit ae90857

Please sign in to comment.