[PATCH] EHCI: fix bug in refcounting code

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
This patch (as927) fixes a recently-introduced refcounting bug in
ehci-hcd.  It's important to remember the difference between
pre-decrement and post-decrement!

Signed-off-by: Alan Stern <[email protected]>
CC: David Brownell <[email protected]>

---

Index: usb-2.6/drivers/usb/host/ehci-mem.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci-mem.c
+++ usb-2.6/drivers/usb/host/ehci-mem.c
@@ -118,7 +118,7 @@ static inline struct ehci_qh *qh_get (st
 
 static inline void qh_put (struct ehci_qh *qh)
 {
-	if (!(qh->refcount--))
+	if (!--qh->refcount)
 		qh_destroy(qh);
 }
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.