aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/misc/iowarrior.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-26 16:49:42 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-26 16:49:42 -0700
commit9a08e732533b940d2d31f4e9999dfee5e1ca3914 (patch)
tree9f3e262bcc4efb2c3bcd0a681dc8732d85b43188 /drivers/usb/misc/iowarrior.c
parentb9e3614f444f6546204f4538afcaa3ebe36d49f2 (diff)
parentd099321bdbba0d49796841cd9d9faf6b0f0aa658 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: USB: ftdio_sio: New IPlus device ID USB: add new device id to option driver USB: fix race leading to use after free in io_edgeport USB: usblcd doesn't limit memory consumption during write USB: memory leak in iowarrior.c USB: ti serial driver sleeps with spinlock held USB: g_file_storage: call allow_signal()
Diffstat (limited to 'drivers/usb/misc/iowarrior.c')
-rw-r--r--drivers/usb/misc/iowarrior.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index fc51207b71b..3bb33f7bfa3 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -495,8 +495,8 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
/* verify that the device wasn't unplugged */
if (!dev->present) {
- mutex_unlock(&dev->mutex);
- return -ENODEV;
+ retval = -ENODEV;
+ goto error_out;
}
dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd,
@@ -579,9 +579,10 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
retval = -ENOTTY;
break;
}
-
+error_out:
/* unlock the device */
mutex_unlock(&dev->mutex);
+ kfree(buffer);
return retval;
}