Skip to content

Commit

Permalink
usblp: Don't let suspend to kill ->used
Browse files Browse the repository at this point in the history
Suspend destroys refcounting for open/release.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed Jun 8, 2007
1 parent dda034b commit 97cb95d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/usb/class/usblp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 97cb95d

Please sign in to comment.