diff options
author | C. Adam Oldham <oldhamca@gmail.com> | 2005-06-02 17:16:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-27 17:44:01 -0400 |
commit | 2c45b6feb394337b4b468229632b8737375caf1d (patch) | |
tree | fc212281c5e750a6d0b3d0148007462f96c1728c /drivers/usb | |
parent | 5da0106f0b9b13afa4a902c01d4c98b002df55ff (diff) |
[PATCH] USB: Fix race condition in usblp_write
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/class/usblp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index bba22e97ea0f..dff134185c18 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -379,6 +379,8 @@ static int usblp_open(struct inode *inode, struct file *file) | |||
379 | usblp->writeurb->transfer_buffer_length = 0; | 379 | usblp->writeurb->transfer_buffer_length = 0; |
380 | usblp->wcomplete = 1; /* we begin writeable */ | 380 | usblp->wcomplete = 1; /* we begin writeable */ |
381 | usblp->rcomplete = 0; | 381 | usblp->rcomplete = 0; |
382 | usblp->writeurb->status = 0; | ||
383 | usblp->readurb->status = 0; | ||
382 | 384 | ||
383 | if (usblp->bidir) { | 385 | if (usblp->bidir) { |
384 | usblp->readcount = 0; | 386 | usblp->readcount = 0; |