patch-2.4.19 linux-2.4.19/drivers/usb/serial/cyberjack.c

Next file: linux-2.4.19/drivers/usb/serial/digi_acceleport.c
Previous file: linux-2.4.19/drivers/usb/serial/Config.in
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/usb/serial/cyberjack.c linux-2.4.19/drivers/usb/serial/cyberjack.c
@@ -238,13 +238,16 @@
 	if( (count+priv->wrfilled)>sizeof(priv->wrbuf) ) {
 		/* To much data  for buffer. Reset buffer. */
 		priv->wrfilled=0;
+		up (&port->sem);
 		return (0);
 	}
 
 	/* Copy data */
 	if (from_user) {
-		if (copy_from_user(priv->wrbuf+priv->wrfilled, buf, count))
+		if (copy_from_user(priv->wrbuf+priv->wrfilled, buf, count)) {
+			up (&port->sem);
 			return -EFAULT;
+		}
 	} else {
 		memcpy (priv->wrbuf+priv->wrfilled, buf, count);
 	}  

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)