aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/vhost/vhost.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 33ac2b186b85..78b5940a415a 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1877,12 +1877,7 @@ static unsigned next_desc(struct vhost_virtqueue *vq, struct vring_desc *desc)
1877 return -1U; 1877 return -1U;
1878 1878
1879 /* Check they're not leading us off end of descriptors. */ 1879 /* Check they're not leading us off end of descriptors. */
1880 next = vhost16_to_cpu(vq, desc->next); 1880 next = vhost16_to_cpu(vq, READ_ONCE(desc->next));
1881 /* Make sure compiler knows to grab that: we don't want it changing! */
1882 /* We will use the result as an index in an array, so most
1883 * architectures only need a compiler barrier here. */
1884 read_barrier_depends();
1885
1886 return next; 1881 return next;
1887} 1882}
1888 1883