mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 14:12:51 +00:00
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:
parent
0145a7141e
commit
781f2dd0a5
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user