Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 781f2dd0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dmitry Torokhov
Browse files

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
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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) {