diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 7b41aad7ec2771b9d6ccf81e32223c7bbcb57889..39ddd9a73febb7f4c3d9b70d9422afcc51c42f02 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -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) {