mirror of https://gitee.com/openkylin/linux.git
drm/amd/amdgpu: fix offset into page with amdgpu_iomem debugfs file
The offset inside the page wasn't included in the copy call meaning the start of the page was being read/written instead. Reported-by: Jay Cornwall <Jay.Cornwall@amd.com> Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
bd08a8d9e8
commit
864917a3b8
|
@ -2021,7 +2021,7 @@ static ssize_t amdgpu_iomem_read(struct file *f, char __user *buf,
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
ptr = kmap(p);
|
ptr = kmap(p);
|
||||||
r = copy_to_user(buf, ptr, bytes);
|
r = copy_to_user(buf, ptr + off, bytes);
|
||||||
kunmap(p);
|
kunmap(p);
|
||||||
if (r)
|
if (r)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
@ -2065,7 +2065,7 @@ static ssize_t amdgpu_iomem_write(struct file *f, const char __user *buf,
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
ptr = kmap(p);
|
ptr = kmap(p);
|
||||||
r = copy_from_user(ptr, buf, bytes);
|
r = copy_from_user(ptr + off, buf, bytes);
|
||||||
kunmap(p);
|
kunmap(p);
|
||||||
if (r)
|
if (r)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
Loading…
Reference in New Issue