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:
Родитель
46c9844c40
Коммит
a08b43aee4
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче