On Fri, Jan 20, 2017 at 06:07:56PM +0100, Paolo Bonzini wrote:
> @@ -762,15 +761,14 @@ void *virtqueue_pop(VirtQueue *vq, size_t sz)
>  
>      i = head;
>  
> -    len = address_space_cache_init(&vring_desc_cache, vdev->dma_as,
> -                                   vq->vring.desc, max * sizeof(VRingDesc),
> -                                   false);
> -    desc_cache = &vring_desc_cache;
> -    if (len < max * sizeof(VRingDesc)) {
> +    rcu_read_lock();
> +    caches = atomic_rcu_read(&vq->vring.caches);
> +    if (caches->desc.len < max * sizeof(VRingDesc)) {
>          virtio_error(vdev, "Cannot map descriptor ring");
>          return NULL;

Missing rcu_read_unlock() in all return cases.

Attachment: signature.asc
Description: PGP signature

Reply via email to