usb: printer double up()

From: Pete Zaitcev
Date: Mon Jul 25 2005 - 14:56:01 EST


Doing a double up() is actually safe in Linux, but still, it's a bug.
This fix is present in 2.6.13-rc3.

By Domen Puncer <domen@xxxxxxxxxxxx>
up(&usblp->sem) was called twice in a row in this code path.

--- linux-2.4.31/drivers/usb/printer.c 2004-08-10 13:43:36.000000000 -0700
+++ linux-2.4.31-usb/drivers/usb/printer.c 2005-06-05 11:21:12.000000000 -0700
@@ -740,6 +740,7 @@ static ssize_t usblp_read(struct file *f
schedule();
} else {
set_current_state(TASK_RUNNING);
+ down (&usblp->sem);
break;
}
down (&usblp->sem);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/