Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a08b43ae authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

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: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 46c9844c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;