linux-mips
[Top] [All Lists]

[PATCH] Fix __copy_{to,from}_user_inatomic

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH] Fix __copy_{to,from}_user_inatomic
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Fri, 16 Feb 2007 16:32:53 +0100
Cc: linux-mips <linux-mips@linux-mips.org>
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:content-type:content-transfer-encoding:from; b=Ltd+Q01BiwMNtXF5wdmQHqn9xGvOQqiLfUStHvrEzdnqLIGW5TkiXHoK1+W7dJFHGtldcgYISTG8Qldk4/P1vHknVJtJFCahKiZWdmiOHerBnI50ARcX3VWcxBPvYIOazJKMcTGBRrZ87aGo2InH8utItuFISOu6WDs6NsCXU18=
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: Franck <vagabon.xyz@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 1.5.0.4 (X11/20060614)
From: Franck Bui-Huu <fbuihuu@gmail.com>

These functions are aliases to __copy_{to,from}_user resp but they
are not allowed to sleep. Therefore might_sleep() must not be used
by their implementions.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
 include/asm-mips/uaccess.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index 825fcbd..fd01939 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -407,7 +407,7 @@ extern size_t __copy_user(void *__to, const void *__from, 
size_t __n);
  * @from: Source address, in kernel space.
  * @n:    Number of bytes to copy.
  *
- * Context: User context only.  This function may sleep.
+ * Context: User context only.
  *
  * Copy data from kernel space to user space.  Caller must check
  * the specified block with access_ok() before calling this function.
@@ -421,7 +421,6 @@ extern size_t __copy_user(void *__to, const void *__from, 
size_t __n);
        const void *__cu_from;                                          \
        long __cu_len;                                                  \
                                                                        \
-       might_sleep();                                                  \
        __cu_to = (to);                                                 \
        __cu_from = (from);                                             \
        __cu_len = (n);                                                 \
@@ -490,7 +489,7 @@ extern size_t __copy_user(void *__to, const void *__from, 
size_t __n);
  * @from: Source address, in user space.
  * @n:    Number of bytes to copy.
  *
- * Context: User context only.  This function may sleep.
+ * Context: User context only.
  *
  * Copy data from user space to kernel space.  Caller must check
  * the specified block with access_ok() before calling this function.
@@ -507,7 +506,6 @@ extern size_t __copy_user(void *__to, const void *__from, 
size_t __n);
        const void __user *__cu_from;                                   \
        long __cu_len;                                                  \
                                                                        \
-       might_sleep();                                                  \
        __cu_to = (to);                                                 \
        __cu_from = (from);                                             \
        __cu_len = (n);                                                 \
-- 
1.4.4.3.ge6d4


<Prev in Thread] Current Thread [Next in Thread>