mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: <marcelo.tosatti@cyclades.com>
Cc: zaitcev@redhat.com, linux-kernel@vger.kernel.org
Subject: usb: printer double up()
Date: Mon, 25 Jul 2005 12:50:46 -0700	[thread overview]
Message-ID: <20050725125046.36398aae.zaitcev@redhat.com> (raw)

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@coderock.org>
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);

                 reply	other threads:[~2005-07-25 19:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050725125046.36398aae.zaitcev@redhat.com \
    --to=zaitcev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®