From 5a1e4609253b229f956f0fcc54433eaec7319e63 Mon Sep 17 00:00:00 2001 From: "Zikim,Wei" Date: Thu, 4 Aug 2016 14:24:10 +0800 Subject: [PATCH] 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 --- drivers/gpu/drm/rockchip/rockchip_drm_rga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_rga.c b/drivers/gpu/drm/rockchip/rockchip_drm_rga.c index 19045b14431d..2e0944ecb02c 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_rga.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_rga.c @@ -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; -- 2.34.1