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>
This commit is contained in:
Tomeu Vizoso 2017-11-27 15:21:25 +01:00 committed by Gerd Hoffmann
parent c2925bde82
commit 424c3f05e1
1 changed files with 2 additions and 0 deletions

View File

@ -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;