summaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorJason Wang2017-07-19 10:54:45 +0200
committerDavid S. Miller2017-07-24 22:37:00 +0200
commit87646a348ebcb1415a479be31f1c41f276e057e6 (patch)
treef1096c513326ae90307e9357886be589b4e4a519 /drivers/virtio
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadkernel-qcow2-linux-87646a348ebcb1415a479be31f1c41f276e057e6.tar.gz
kernel-qcow2-linux-87646a348ebcb1415a479be31f1c41f276e057e6.tar.xz
kernel-qcow2-linux-87646a348ebcb1415a479be31f1c41f276e057e6.zip
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>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio_ring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 5e1b548828e6..9aaa177e8209 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -391,7 +391,7 @@ static inline int virtqueue_add(struct virtqueue *_vq,
vq->desc_state[head].data = data;
if (indirect)
vq->desc_state[head].indir_desc = desc;
- if (ctx)
+ else
vq->desc_state[head].indir_desc = ctx;
/* Put entry in available array (but don't update avail->idx until they