diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-05-25 13:33:11 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-07-04 13:16:24 -0400 |
commit | d5288c88c67c388091fa0281640b586b4941e3d5 (patch) | |
tree | 8a31c407b9156175d7694f18bbdb14bf5eec5aca | |
parent | 1a36bf1da632670f9b0a1fc0d63dd65e0ad2483d (diff) |
switch compat_drm_wait_vblank() to drm_ioctl_kernel()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/gpu/drm/drm_ioc32.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 752cb36a1cb7..60a7160a403f 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c | |||
@@ -837,29 +837,23 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, | |||
837 | { | 837 | { |
838 | drm_wait_vblank32_t __user *argp = (void __user *)arg; | 838 | drm_wait_vblank32_t __user *argp = (void __user *)arg; |
839 | drm_wait_vblank32_t req32; | 839 | drm_wait_vblank32_t req32; |
840 | union drm_wait_vblank __user *request; | 840 | union drm_wait_vblank req; |
841 | int err; | 841 | int err; |
842 | 842 | ||
843 | if (copy_from_user(&req32, argp, sizeof(req32))) | 843 | if (copy_from_user(&req32, argp, sizeof(req32))) |
844 | return -EFAULT; | 844 | return -EFAULT; |
845 | 845 | ||
846 | request = compat_alloc_user_space(sizeof(*request)); | 846 | req.request.type = req32.request.type; |
847 | if (!request | 847 | req.request.sequence = req32.request.sequence; |
848 | || __put_user(req32.request.type, &request->request.type) | 848 | req.request.signal = req32.request.signal; |
849 | || __put_user(req32.request.sequence, &request->request.sequence) | 849 | err = drm_ioctl_kernel(file, drm_wait_vblank, &req, DRM_UNLOCKED); |
850 | || __put_user(req32.request.signal, &request->request.signal)) | ||
851 | return -EFAULT; | ||
852 | |||
853 | err = drm_ioctl(file, DRM_IOCTL_WAIT_VBLANK, (unsigned long)request); | ||
854 | if (err) | 850 | if (err) |
855 | return err; | 851 | return err; |
856 | 852 | ||
857 | if (__get_user(req32.reply.type, &request->reply.type) | 853 | req32.reply.type = req.reply.type; |
858 | || __get_user(req32.reply.sequence, &request->reply.sequence) | 854 | req32.reply.sequence = req.reply.sequence; |
859 | || __get_user(req32.reply.tval_sec, &request->reply.tval_sec) | 855 | req32.reply.tval_sec = req.reply.tval_sec; |
860 | || __get_user(req32.reply.tval_usec, &request->reply.tval_usec)) | 856 | req32.reply.tval_usec = req.reply.tval_usec; |
861 | return -EFAULT; | ||
862 | |||
863 | if (copy_to_user(argp, &req32, sizeof(req32))) | 857 | if (copy_to_user(argp, &req32, sizeof(req32))) |
864 | return -EFAULT; | 858 | return -EFAULT; |
865 | 859 | ||
@@ -960,7 +954,7 @@ static struct { | |||
960 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) | 954 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) |
961 | DRM_IOCTL32_DEF(DRM_IOCTL_UPDATE_DRAW, compat_drm_update_draw), | 955 | DRM_IOCTL32_DEF(DRM_IOCTL_UPDATE_DRAW, compat_drm_update_draw), |
962 | #endif | 956 | #endif |
963 | [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)].fn = compat_drm_wait_vblank, | 957 | DRM_IOCTL32_DEF(DRM_IOCTL_WAIT_VBLANK, compat_drm_wait_vblank), |
964 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) | 958 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) |
965 | [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)].fn = compat_drm_mode_addfb2, | 959 | [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)].fn = compat_drm_mode_addfb2, |
966 | #endif | 960 | #endif |