Re: [PATCH]usblp read race
Pete Zaitcev <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Organization | Red Hat, Inc. |
| Message-ID | <[email protected]> |
On Fri, 30 Mar 2007 18:16:15 +0200, Oliver Neukum <[email protected]> wrote: > --- a/drivers/usb/class/usblp.c 2007-03-30 18:02:44.000000000 +0200 > +lost_race: > mutex_unlock(&usblp->mut); > rv = wait_event_interruptible(usblp->wait, usblp->rcomplete || !usblp->present); > mutex_lock(&usblp->mut); > @@ -788,6 +789,8 @@ > count = -EINTR; > goto done; > } > + if (!usblp->rcomplete) > + goto lost_race; What did I tell you about wait_event? It would be far cleaner to open-code the loop. -- Pete ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel