Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: uinput - unlock on allocation failure in ioctl

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

Fixes: 04ce40a61a91 ("Input: uinput - remove uinput_allocate_device()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Dan Carpenter and committed by
Dmitry Torokhov
781f2dd0 0145a714

+4 -2
+4 -2
drivers/input/misc/uinput.c
··· 857 857 858 858 if (!udev->dev) { 859 859 udev->dev = input_allocate_device(); 860 - if (!udev->dev) 861 - return -ENOMEM; 860 + if (!udev->dev) { 861 + retval = -ENOMEM; 862 + goto out; 863 + } 862 864 } 863 865 864 866 switch (cmd) {