From: C. Adam Oldham Date: Thu, 2 Jun 2005 21:16:34 +0000 (-0400) Subject: [PATCH] USB: Fix race condition in usblp_write X-Git-Tag: v2.6.13-rc1~51^2~8^2~9 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=2c45b6feb394337b4b468229632b8737375caf1d;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index bba22e97ea0..dff134185c1 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) 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;