Input: uinput - unlock on allocation failure in ioctl

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

Fixes: 04ce40a61a ("Input: uinput - remove uinput_allocate_device()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dan Carpenter 2017-11-10 10:21:53 -08:00 committed by Dmitry Torokhov
parent 0145a7141e
commit 781f2dd0a5

View File

@ -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) {