patch-2.4.23 linux-2.4.23/drivers/usb/mdc800.c
Next file: linux-2.4.23/drivers/usb/pwc-ctrl.c
Previous file: linux-2.4.23/drivers/usb/host/uhci-debug.h
Back to the patch index
Back to the overall index
-  Lines: 12
-  Date:
2003-11-28 10:26:20.000000000 -0800
-  Orig file: 
linux-2.4.22/drivers/usb/mdc800.c
-  Orig date: 
2003-06-13 07:51:36.000000000 -0700
diff -urN linux-2.4.22/drivers/usb/mdc800.c linux-2.4.23/drivers/usb/mdc800.c
@@ -726,7 +726,10 @@
 		else
 		{
 			/* memcpy Bytes */
-			copy_to_user(ptr, &mdc800->out [mdc800->out_ptr], sts);
+			if (copy_to_user(ptr, &mdc800->out [mdc800->out_ptr], sts)) {
+				up (&mdc800->io_lock);
+				return -EFAULT;
+			}
 			ptr+=sts;
 			left-=sts;
 			mdc800->out_ptr+=sts;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)