diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2016-12-05 22:36:56 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-12-15 06:59:16 +0200 |
commit | f862e60f8d52dae33c9f72afc20fab691a89f0bd (patch) | |
tree | 1682645af77b1128e72ad32ad4c39e64d8715508 /drivers | |
parent | 8854a56f3e71703e0253697e4cc82b20acf732dc (diff) |
drm/virtio: fix lock context imbalance
When virtio_gpu_free_vbufs exits due to list empty, it does not
drop the free_vbufs lock that it took.
list empty is not expected to happen anyway, but it can't hurt to fix
this and drop the lock.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_vq.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 974f9410474b..abfc54a18f1a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -109,8 +109,10 @@ void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev) spin_lock(&vgdev->free_vbufs_lock); for (i = 0; i < count; i++) { - if (WARN_ON(list_empty(&vgdev->free_vbufs))) + if (WARN_ON(list_empty(&vgdev->free_vbufs))) { + spin_unlock(&vgdev->free_vbufs_lock); return; + } vbuf = list_first_entry(&vgdev->free_vbufs, struct virtio_gpu_vbuffer, list); list_del(&vbuf->list); |