summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/vstusb.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-03-11 21:47:39 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-17 14:01:29 -0700
commita08b43aee46ed4272ad7bee2c785edcf313339b3 (patch)
tree8c51ce0a99c625a1c45a7b7149a1305be4fa5281 /drivers/usb/misc/vstusb.c
parent46c9844c4014be53c67622dcd3ba4302f36e9cac (diff)
downloadop-kernel-dev-a08b43aee46ed4272ad7bee2c785edcf313339b3.zip
op-kernel-dev-a08b43aee46ed4272ad7bee2c785edcf313339b3.tar.gz
USB: misc/vstusb, fix lock imbalance
Make sure we don't leak locked vstdev->lock in vstusb_write. Unlock properly on one fail path. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc/vstusb.c')
-rw-r--r--drivers/usb/misc/vstusb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/misc/vstusb.c b/drivers/usb/misc/vstusb.c
index 63dff9b..f26ea8d 100644
--- a/drivers/usb/misc/vstusb.c
+++ b/drivers/usb/misc/vstusb.c
@@ -401,6 +401,7 @@ static ssize_t vstusb_write(struct file *file, const char __user *buffer,
}
if (copy_from_user(buf, buffer, count)) {
+ mutex_unlock(&vstdev->lock);
dev_err(&dev->dev, "%s: can't copy_from_user\n", __func__);
retval = -EFAULT;
goto exit;
OpenPOWER on IntegriCloud