Linux Input/HID development
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Henrik Rydberg <rydberg@bitmath.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Input: uinput - unlock on allocation failure in ioctl
Date: Fri, 10 Nov 2017 10:22:27 -0800	[thread overview]
Message-ID: <20171110182227.y2sqa3vtms5pn53h@dtor-ws> (raw)
In-Reply-To: <20171108083946.vbsixgkodhw6jh4q@mwanda>

On Wed, Nov 08, 2017 at 11:39:46AM +0300, Dan Carpenter wrote:
> 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>

Applied, thank you.


> 
> 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) {

-- 
Dmitry

      reply	other threads:[~2017-11-10 18:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  8:39 [PATCH] Input: uinput - unlock on allocation failure in ioctl Dan Carpenter
2017-11-10 18:22 ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171110182227.y2sqa3vtms5pn53h@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=rydberg@bitmath.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox