aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/usb-skeleton.c
diff options
context:
space:
mode:
authorMark Gross <mgross@linux.intel.com>2007-09-24 12:28:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:26 -0400
commitf7294055a7a5bf1ea7da16dffb0cb0f7a282c04b (patch)
tree3b296fd7b8c1a73e9c7d0944cb7bb7b56061bdfc /drivers/usb/usb-skeleton.c
parent6840d2555afd66290be7a39b400b5e66a840b82d (diff)
USB: usb-skeleton leaking locks on open
This weekend I was hacking around with a trivial USB driver for talking to the boot load firmware of a USB Bit Whacker. It's running the MicroChip Pic18 boot loader firmware and I'm putting together a flash program for writing new FW to the thing. Anyway in my use of the usb-skeleton.c as my starting point I discovered my test program was getting hung up after attempting to write a buffer. The application and driver where hung in a way that required me to reboot to get it to clean up so I could try again. It turned out the code path through skel_open can grap the driver's io_mutex lock and forget to release it. The following patch fixes the problem for me. Signed-off-by: Mark Gross <mgross@linux.intel.com> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/usb-skeleton.c')
-rw-r--r--drivers/usb/usb-skeleton.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index 8de11deb5d14..c815a40e167f 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -125,6 +125,7 @@ static int skel_open(struct inode *inode, struct file *file)
125 125
126 /* save our object in the file's private structure */ 126 /* save our object in the file's private structure */
127 file->private_data = dev; 127 file->private_data = dev;
128 mutex_unlock(&dev->io_mutex);
128 129
129exit: 130exit:
130 return retval; 131 return retval;