Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 424c3f05 authored by Tomeu Vizoso's avatar Tomeu Vizoso Committed by Gerd Hoffmann
Browse files

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: default avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20171127142126.25765-1-tomeu.vizoso@collabora.com


Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent c2925bde
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;