Commit 8535f431 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86-64: add might_sleeps to more *_user functions

Add might_sleep to more *_user functions.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1ac70e06
......@@ -22,6 +22,7 @@ unsigned int
csum_partial_copy_from_user(const char __user *src, char *dst,
int len, unsigned int isum, int *errp)
{
might_sleep();
*errp = 0;
if (likely(access_ok(VERIFY_READ,src, len))) {
/* Why 6, not 7? To handle odd addresses aligned we
......@@ -69,6 +70,7 @@ unsigned int
csum_partial_copy_to_user(const char *src, char __user *dst,
int len, unsigned int isum, int *errp)
{
might_sleep();
if (unlikely(!access_ok(VERIFY_WRITE, dst, len))) {
*errp = -EFAULT;
return 0;
......
......@@ -14,6 +14,7 @@
#define __do_strncpy_from_user(dst,src,count,res) \
do { \
long __d0, __d1, __d2; \
might_sleep(); \
__asm__ __volatile__( \
" testq %1,%1\n" \
" jz 2f\n" \
......@@ -63,6 +64,7 @@ strncpy_from_user(char *dst, const char __user *src, long count)
unsigned long __clear_user(void __user *addr, unsigned long size)
{
long __d0;
might_sleep();
/* no memory constraint because it doesn't change any memory gcc knows
about */
asm volatile(
......
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