Commit 97cb95d1 authored by Pete Zaitcev's avatar Pete Zaitcev Committed by Greg Kroah-Hartman

usblp: Don't let suspend to kill ->used

Suspend destroys refcounting for open/release.
Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent dda034bc
...@@ -347,10 +347,8 @@ static int handle_bidir (struct usblp *usblp) ...@@ -347,10 +347,8 @@ static int handle_bidir (struct usblp *usblp)
if (usblp->bidir && usblp->used && !usblp->sleeping) { if (usblp->bidir && usblp->used && !usblp->sleeping) {
usblp->readcount = 0; usblp->readcount = 0;
usblp->readurb->dev = usblp->dev; usblp->readurb->dev = usblp->dev;
if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) { if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0)
usblp->used = 0;
return -EIO; return -EIO;
}
} }
return 0; return 0;
...@@ -412,6 +410,7 @@ static int usblp_open(struct inode *inode, struct file *file) ...@@ -412,6 +410,7 @@ static int usblp_open(struct inode *inode, struct file *file)
usblp->readurb->status = 0; usblp->readurb->status = 0;
if (handle_bidir(usblp) < 0) { if (handle_bidir(usblp) < 0) {
usblp->used = 0;
file->private_data = NULL; file->private_data = NULL;
retval = -EIO; retval = -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment