]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390/zcore: Fix HSA copy length for last block
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Fri, 19 Apr 2013 16:03:02 +0000 (18:03 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 23 Apr 2013 08:18:07 +0000 (10:18 +0200)
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>
drivers/s390/char/zcore.c

index 1d61a01576d213ac600e367e231272a2fbbcb5dc..22820610022c6e21a190c06d1b014ae7b900e33d 100644 (file)
@@ -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);