diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-02-07 08:49:17 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-02-07 08:49:17 +0100 |
commit | 87a8d03266a55f18f31fdb71c28a8dcffe39124d (patch) | |
tree | ab337ca060871296a8dc5d47fcd45da9dcb17a3a /drivers/vhost/vsock.c | |
parent | efi/libstub: Preserve .debug sections after absolute relocation check (diff) | |
parent | Linux 4.10-rc7 (diff) | |
download | linux-87a8d03266a55f18f31fdb71c28a8dcffe39124d.tar.xz linux-87a8d03266a55f18f31fdb71c28a8dcffe39124d.zip |
Merge tag 'v4.10-rc7' into efi/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/vhost/vsock.c')
-rw-r--r-- | drivers/vhost/vsock.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bbbf588540ed..ce5e63d2c66a 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -373,6 +373,7 @@ static void vhost_vsock_handle_rx_kick(struct vhost_work *work) static int vhost_vsock_start(struct vhost_vsock *vsock) { + struct vhost_virtqueue *vq; size_t i; int ret; @@ -383,19 +384,20 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) goto err; for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) { - struct vhost_virtqueue *vq = &vsock->vqs[i]; + vq = &vsock->vqs[i]; mutex_lock(&vq->mutex); if (!vhost_vq_access_ok(vq)) { ret = -EFAULT; - mutex_unlock(&vq->mutex); goto err_vq; } if (!vq->private_data) { vq->private_data = vsock; - vhost_vq_init_access(vq); + ret = vhost_vq_init_access(vq); + if (ret) + goto err_vq; } mutex_unlock(&vq->mutex); @@ -405,8 +407,11 @@ static int vhost_vsock_start(struct vhost_vsock *vsock) return 0; err_vq: + vq->private_data = NULL; + mutex_unlock(&vq->mutex); + for (i = 0; i < ARRAY_SIZE(vsock->vqs); i++) { - struct vhost_virtqueue *vq = &vsock->vqs[i]; + vq = &vsock->vqs[i]; mutex_lock(&vq->mutex); vq->private_data = NULL; |