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 <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Michael Holzheu 2013-04-19 18:03:02 +02:00 committed by Martin Schwidefsky
parent ab8e523586
commit 241fd9bcbc

View File

@ -127,7 +127,7 @@ static int memcpy_hsa(void *dest, unsigned long src, size_t count, int mode)
} }
if (mode == TO_USER) { if (mode == TO_USER) {
if (copy_to_user((__force __user void*) dest + offs, buf, if (copy_to_user((__force __user void*) dest + offs, buf,
PAGE_SIZE)) count - offs))
return -EFAULT; return -EFAULT;
} else } else
memcpy(dest + offs, buf, count - offs); memcpy(dest + offs, buf, count - offs);