Re: patch usb-iowarrior.patch added to gregkh-2.6 tree
Greg KH <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Feb 15, 2007 at 03:18:23PM +0100, Samuel Ortiz wrote: > [email protected] wrote: > > >+static int iowarrior_release(struct inode *inode, struct file *file) > >+{ > >+ struct iowarrior *dev; > >+ int retval = 0; > >+ > >+ dev = (struct iowarrior *)file->private_data; > >+ if (dev == NULL) { > >+ return -ENODEV; > >+ } > >+ > >+ dbg("%s - minor %d", __func__, dev->minor); > >+ > >+ /* lock our device */ > >+ mutex_lock(&dev->mutex); > >+ > >+ if (dev->opened <= 0) { > >+ retval = -ENODEV; /* close called more than once */ > >+ } else { > >+ dev->opened = 0; /* we're closeing now */ > >+ retval = 0; > >+ if (dev->present) { > >+ /* > >+ The device is still connected so we only shutdown > >+ pending read-/write-ops. > >+ */ > >+ usb_kill_urb(dev->int_in_urb); > >+ wake_up_interruptible(&dev->read_wait); > >+ wake_up_interruptible(&dev->write_wait); > >+ mutex_lock(&dev->mutex); > Isn't it mutex_unlock() that should be called here ? Yes, you are right, thanks for finding this, I caused it when I converted from a semaphore to a mutex. thanks, greg k-h ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel