linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: uinput - unlock on allocation failure in ioctl
@ 2017-11-08  8:39 Dan Carpenter
  2017-11-10 18:22 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-11-08  8:39 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Henrik Rydberg, Benjamin Tissoires, linux-input, kernel-janitors

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>

diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 7b41aad7ec27..39ddd9a73feb 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) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-10 18:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08  8:39 [PATCH] Input: uinput - unlock on allocation failure in ioctl Dan Carpenter
2017-11-10 18:22 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).