From: Michael Holzheu Date: Fri, 19 Apr 2013 16:03:02 +0000 (+0200) Subject: s390/zcore: Fix HSA copy length for last block X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=241fd9bcbc10c144531e88b5e3a62bc11090e5e4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 1d61a01576d2..22820610022c 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c @@ -127,7 +127,7 @@ static int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode) } if (mode == TO_USER) { if (copy_to_user((__force __user void*) dest + offs, buf, - PAGE_SIZE)) + count - offs)) return -EFAULT; } else memcpy(dest + offs, buf, count - offs);