Commit 781f2dd0 authored by Dan Carpenter's avatar Dan Carpenter Committed by 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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment