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>
                        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;
                        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;