usb: printer double up()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux