summaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_ring.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-08-01 19:23:53 -0700
committerEric Anholt <eric@anholt.net>2010-08-01 19:34:47 -0700
commit2bd34f6ca86b5a5f9b749624f73310820e7a93fd (patch)
tree9e42100423e78f400412dfa974a6a13bac94d2c0 /drivers/virtio/virtio_ring.c
parenta2757b6fab6dee3dbf43bdb7d7226d03747fbdb1 (diff)
parent9fe6206f400646a2322096b56c59891d530e8d51 (diff)
Merge remote branch 'origin/master' into drm-intel-next
This resolves the conflict in the EDP code, which has been rather popular to hack on recently. Conflicts: drivers/gpu/drm/i915/intel_dp.c
Diffstat (limited to 'drivers/virtio/virtio_ring.c')
-rw-r--r--drivers/virtio/virtio_ring.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index afe7e21dd0a..1475ed6b575 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -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);
@@ -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;
}