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) {
|
if (!udev->dev) {
|
||||||
udev->dev = input_allocate_device();
|
udev->dev = input_allocate_device();
|
||||||
if (!udev->dev)
|
if (!udev->dev) {
|
||||||
return -ENOMEM;
|
retval = -ENOMEM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
Loading…
Reference in New Issue
Block a user