提交 864917a3 编写于 作者: T Tom St Denis 提交者: Alex Deucher

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: NJay Cornwall <Jay.Cornwall@amd.com>
Signed-off-by: NTom St Denis <tom.stdenis@amd.com>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 bd08a8d9
......@@ -2021,7 +2021,7 @@ static ssize_t amdgpu_iomem_read(struct file *f, char __user *buf,
return -EPERM;
ptr = kmap(p);
r = copy_to_user(buf, ptr, bytes);
r = copy_to_user(buf, ptr + off, bytes);
kunmap(p);
if (r)
return -EFAULT;
......@@ -2065,7 +2065,7 @@ static ssize_t amdgpu_iomem_write(struct file *f, const char __user *buf,
return -EPERM;
ptr = kmap(p);
r = copy_from_user(ptr, buf, bytes);
r = copy_from_user(ptr + off, buf, bytes);
kunmap(p);
if (r)
return -EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册