Subject: [PATCH 14 of 14] USB cyberjack driver bugfix
From: Greg KH <[email-masked]>
To: [email-masked]
Cc: [email-masked]

Hi,

Here's a patch against 2.4.19-pre2 that fixes a bug in the usb-serial
cyberjack driver.  Thanks to Shane Nay for pointing this problem out.

thanks,

greg k-h

diff -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.c	Mon Mar  4 08:49:01 2002
+++ b/drivers/usb/serial/cyberjack.c	Mon Mar  4 08:49:01 2002
@@ -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);
 	}