Commit 864917a3 authored by Tom St Denis's avatar Tom St Denis Committed by 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: default avatarJay Cornwall <Jay.Cornwall@amd.com>
Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bd08a8d9
...@@ -2021,7 +2021,7 @@ static ssize_t amdgpu_iomem_read(struct file *f, char __user *buf, ...@@ -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, ...@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment