提交 781f2dd0 编写于 作者: D Dan Carpenter 提交者: Dmitry Torokhov

Input: uinput - unlock on allocation failure in ioctl

We have to unlock before returning if input_allocate_device() fails.

Fixes: 04ce40a6 ("Input: uinput - remove uinput_allocate_device()")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 0145a714
......@@ -857,8 +857,10 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
if (!udev->dev) {
udev->dev = input_allocate_device();
if (!udev->dev)
return -ENOMEM;
if (!udev->dev) {
retval = -ENOMEM;
goto out;
}
}
switch (cmd) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册