From: Jiri Slaby Date: Wed, 11 Mar 2009 20:47:39 +0000 (+0100) Subject: USB: misc/vstusb, fix lock imbalance X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a08b43aee46ed4272ad7bee2c785edcf313339b3;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/vstusb.c b/drivers/usb/misc/vstusb.c index 63dff9ba73c5..f26ea8dc1577 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;