Skip to content

Commit

Permalink
[PATCH] USB: Fix race condition in usblp_write
Browse files Browse the repository at this point in the history
Initialize status fields in the read and write urbs to prevent a race
condition with open/read/close - open/write/close sequences.

Fixes bug #4432 at bugzilla.kernel.org

Signed-off-by: Adam Oldham <oldhamca@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
C. Adam Oldham authored and Greg Kroah-Hartman committed Jun 27, 2005
1 parent 5da0106 commit 2c45b6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/class/usblp.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ static int usblp_open(struct inode *inode, struct file *file)
usblp->writeurb->transfer_buffer_length = 0;
usblp->wcomplete = 1; /* we begin writeable */
usblp->rcomplete = 0;
usblp->writeurb->status = 0;
usblp->readurb->status = 0;

if (usblp->bidir) {
usblp->readcount = 0;
Expand Down

0 comments on commit 2c45b6f

Please sign in to comment.