From 366c9802fd86adcc01b2f8ee6f10f5763b72a797 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 9 Sep 2021 04:09:41 +0000 Subject: [PATCH] drm: Copy drm_wait_vblank to user before returning From Mark Yacoub 6fd6e20520ccd05a1ac3321404dd498cc28576cb in linux 5.10.y/5.10.62 fa0b1ef5f7a694f48e00804a391245f3471aa155 in mainline linux --- sys/dev/pci/drm/drm_ioc32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/pci/drm/drm_ioc32.c b/sys/dev/pci/drm/drm_ioc32.c index dc734d4828a..aaf8d625ce1 100644 --- a/sys/dev/pci/drm/drm_ioc32.c +++ b/sys/dev/pci/drm/drm_ioc32.c @@ -865,8 +865,6 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, req.request.sequence = req32.request.sequence; req.request.signal = req32.request.signal; err = drm_ioctl_kernel(file, drm_wait_vblank_ioctl, &req, DRM_UNLOCKED); - if (err) - return err; req32.reply.type = req.reply.type; req32.reply.sequence = req.reply.sequence; @@ -875,7 +873,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, if (copy_to_user(argp, &req32, sizeof(req32))) return -EFAULT; - return 0; + return err; } #if defined(CONFIG_X86) -- 2.20.1