[PATCH] pcmcia: handle __copy_from_user in ioctl

Randy Dunlap randy.dunlap at oracle.com
Sat Nov 18 00:54:01 EST 2006


From: Randy Dunlap <randy.dunlap at oracle.com>

Handle __copy_from_user() return value.

drivers/pcmcia/pcmcia_ioctl.c:597: warning: ignoring return value of '__copy_from_user', declared with attribute warn_unused_result

Signed-off-by: Randy Dunlap <randy.dunlap at oracle.com>
---
 drivers/pcmcia/pcmcia_ioctl.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- linux-2619-rc5mm2.orig/drivers/pcmcia/pcmcia_ioctl.c
+++ linux-2619-rc5mm2/drivers/pcmcia/pcmcia_ioctl.c
@@ -594,7 +594,9 @@ static int ds_ioctl(struct inode * inode
 
     err = ret = 0;
 
-    if (cmd & IOC_IN) __copy_from_user((char *)buf, uarg, size);
+    if (cmd & IOC_IN)
+	if (__copy_from_user((char *)buf, uarg, size))
+	    return -EFAULT;
 
     switch (cmd) {
     case DS_ADJUST_RESOURCE_INFO:


---



More information about the linux-pcmcia mailing list