diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2017-11-27 15:21:25 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-02-01 17:45:41 +0100 |
commit | 424c3f05e1673b684881b487771d38d276750b3d (patch) | |
tree | dadde921e102178829490b7b759c2a55b1ba84e9 /drivers | |
parent | c2925bde829a748265a69aef128f0a88d82cb689 (diff) |
drm/virtio: Don't return invalid caps on timeout
If the wait timeouts, the caps are probably invalid and we shouldn't be
passing them to userspace.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20171127142126.25765-1-tomeu.vizoso@collabora.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 5720a0d4ac0a..355569a9b5cb 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -518,6 +518,8 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev, ret = wait_event_timeout(vgdev->resp_wq, atomic_read(&cache_ent->is_valid), 5 * HZ); + if (!ret) + return -EBUSY; ptr = cache_ent->caps_cache; |