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

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)