mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
5da0106f0b
commit
2c45b6feb3
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue