Commit ae1fed0d authored by Anton Blanchard's avatar Anton Blanchard

ppc64: Fix clear_user, from ppc32

parent 96ac7f8e
......@@ -240,7 +240,11 @@ clear_user(void *addr, unsigned long size)
{
if (access_ok(VERIFY_WRITE, addr, size))
return __clear_user(addr, size);
return size? -EFAULT: 0;
if ((unsigned long)addr < TASK_SIZE) {
unsigned long over = (unsigned long)addr + size - TASK_SIZE;
return __clear_user(addr, size - over) + over;
}
return size;
}
extern int __strncpy_from_user(char *dst, const char *src, long count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment