mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
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>
This commit is contained in:
parent
46c9844c40
commit
a08b43aee4
@ -401,6 +401,7 @@ static ssize_t vstusb_write(struct file *file, const char __user *buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (copy_from_user(buf, buffer, count)) {
|
if (copy_from_user(buf, buffer, count)) {
|
||||||
|
mutex_unlock(&vstdev->lock);
|
||||||
dev_err(&dev->dev, "%s: can't copy_from_user\n", __func__);
|
dev_err(&dev->dev, "%s: can't copy_from_user\n", __func__);
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
goto exit;
|
goto exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user