]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] USB: Fix race condition in usblp_write
authorC. Adam Oldham <oldhamca@gmail.com>
Thu, 2 Jun 2005 21:16:34 +0000 (17:16 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 27 Jun 2005 21:44:01 +0000 (14:44 -0700)
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>
drivers/usb/class/usblp.c

index bba22e97ea0f0efefdde0d958d3b035c269f6f17..dff134185c18a94612f313fce8428733360ec18d 100644 (file)
@@ -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;