drm/rockchip: Fix drm rga driver for arm64

compat_uptr_t is defined in asm/compat.h:
typedef u32 		compat_uptr_t;
but cmd and cmd_buf store the user pointers.
Do not convert 64 bit pointer to 32 bit, it
will lead copy_from_user fail.

Change-Id: Ia0435f2a495bbe64d583e213349cb9f041c9d75a
Signed-off-by: Zikim,Wei <wzq@rock-chips.com>
This commit is contained in:
Zikim,Wei
2016-08-04 14:24:10 +08:00
parent fbf358e500
commit 5a1e460925

View File

@@ -550,13 +550,13 @@ int rockchip_rga_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
* command have two integer, one for register offset, another for
* register value.
*/
if (copy_from_user(cmdlist->data, compat_ptr((compat_uptr_t)req->cmd),
if (copy_from_user(cmdlist->data, (void __user *)req->cmd,
sizeof(struct drm_rockchip_rga_cmd) * req->cmd_nr))
return -EFAULT;
cmdlist->last += req->cmd_nr * 2;
if (copy_from_user(&cmdlist->data[cmdlist->last],
compat_ptr((compat_uptr_t)req->cmd_buf),
(void __user *)req->cmd_buf,
sizeof(struct drm_rockchip_rga_cmd) * req->cmd_buf_nr))
return -EFAULT;
cmdlist->last += req->cmd_buf_nr * 2;