linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: benjamin.tissoires@redhat.com, masaki.ota@jp.alps.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] HID: alps: Fix an error handling path in 'alps_input_configured()'
Date: Wed, 12 Feb 2020 15:06:58 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2002121506510.3144@cbobk.fhfr.pm> (raw)
In-Reply-To: <20191204033525.10871-1-christophe.jaillet@wanadoo.fr>

On Wed, 4 Dec 2019, Christophe JAILLET wrote:

> They are issues:
>    - if 'input_allocate_device()' fails and return NULL, there is no need
>      to free anything and 'input_free_device()' call is a no-op. It can
>      be axed.
>    - 'ret' is known to be 0 at this point, so we must set it to a
>      meaningful value before returning
> 
> Fixes: 2562756dde55 ("HID: add Alps I2C HID Touchpad-Stick support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/hid/hid-alps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
> index ae79a7c66737..fa704153cb00 100644
> --- a/drivers/hid/hid-alps.c
> +++ b/drivers/hid/hid-alps.c
> @@ -730,7 +730,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
>  	if (data->has_sp) {
>  		input2 = input_allocate_device();
>  		if (!input2) {
> -			input_free_device(input2);
> +			ret = -ENOMEM;
>  			goto exit;
>  		}

Applied, thank you.

-- 
Jiri Kosina
SUSE Labs


      reply	other threads:[~2020-02-12 14:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04  3:35 [PATCH] HID: alps: Fix an error handling path in 'alps_input_configured()' Christophe JAILLET
2020-02-12 14:06 ` Jiri Kosina [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=nycvar.YFH.7.76.2002121506510.3144@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masaki.ota@jp.alps.com \
    /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;
as well as URLs for NNTP newsgroup(s).