virtio_balloon: fix race by fill and leak
[deliverable/linux.git] / drivers / virtio / virtio_balloon.c
index 7efc32945810e8fdcafa76a6328517f35d65ea3c..7d3e5d0e9aa4ff907ab5e51284b57b9492bf3891 100644 (file)
@@ -209,8 +209,8 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
         */
        if (vb->num_pfns != 0)
                tell_host(vb, vb->deflate_vq);
-       mutex_unlock(&vb->balloon_lock);
        release_pages_balloon(vb);
+       mutex_unlock(&vb->balloon_lock);
        return num_freed_pages;
 }
 
This page took 0.079776 seconds and 5 git commands to generate.