From: Pete Zaitcev Date: Fri, 25 May 2007 04:59:19 +0000 (-0700) Subject: usblp: Don't let suspend to kill ->used X-Git-Tag: v2.6.22-rc5~60^2~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97cb95d1c4b724bc3bedd16dd022fbd3c2d61283;p=linux-2.6 usblp: Don't let suspend to kill ->used Suspend destroys refcounting for open/release. Signed-off-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 7b1edfe46b..6778f9af79 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -347,10 +347,8 @@ static int handle_bidir (struct usblp *usblp) if (usblp->bidir && usblp->used && !usblp->sleeping) { usblp->readcount = 0; usblp->readurb->dev = usblp->dev; - if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) { - usblp->used = 0; + if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) return -EIO; - } } return 0; @@ -412,6 +410,7 @@ static int usblp_open(struct inode *inode, struct file *file) usblp->readurb->status = 0; if (handle_bidir(usblp) < 0) { + usblp->used = 0; file->private_data = NULL; retval = -EIO; }