Skip to content

Commit 87646a3

Browse files
jasowangdavem330
authored andcommitted
virtio_ring: allow to store zero as the ctx
Allow zero to be store as a ctx, with this we could store e.g zero value which could be meaningful for the case of storing headroom through ctx. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7a68ada commit 87646a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/virtio/virtio_ring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
391391
vq->desc_state[head].data = data;
392392
if (indirect)
393393
vq->desc_state[head].indir_desc = desc;
394-
if (ctx)
394+
else
395395
vq->desc_state[head].indir_desc = ctx;
396396

397397
/* Put entry in available array (but don't update avail->idx until they

0 commit comments

Comments
 (0)