提交 a08b43ae 编写于 作者: J Jiri Slaby 提交者: Greg Kroah-Hartman

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: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 46c9844c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册