Skip to content

Commit 241fd9b

Browse files
Michael HolzheuMartin Schwidefsky
authored andcommitted
s390/zcore: Fix HSA copy length for last block
Currently always one page is copied to a user buffer for the last HSA block in memcpy_hsa(). Now the correct length is used. Signed-off-by: Michael Holzheu <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent ab8e523 commit 241fd9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/char/zcore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode)
127127
}
128128
if (mode == TO_USER) {
129129
if (copy_to_user((__force __user void*) dest + offs, buf,
130-
PAGE_SIZE))
130+
count - offs))
131131
return -EFAULT;
132132
} else
133133
memcpy(dest + offs, buf, count - offs);

0 commit comments

Comments
 (0)