linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: ALPS - fix memory leak when detection fails
Date: Sat, 28 Feb 2015 12:04:25 +0100	[thread overview]
Message-ID: <201502281204.25691@pali> (raw)
In-Reply-To: <20150227235357.GA13166@dtor-ws>

[-- Attachment #1: Type: Text/Plain, Size: 885 bytes --]

On Saturday 28 February 2015 00:53:57 Dmitry Torokhov wrote:
> This fixes memory leak introduced by commit
> a09221e83e13e09a33109b9b037484eade901cea
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/input/mouse/alps.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/mouse/alps.c
> b/drivers/input/mouse/alps.c index d28726a..1bd15eb 100644
> --- a/drivers/input/mouse/alps.c
> +++ b/drivers/input/mouse/alps.c
> @@ -2605,8 +2605,10 @@ int alps_detect(struct psmouse
> *psmouse, bool set_properties) return -ENOMEM;
> 
>  	error = alps_identify(psmouse, priv);
> -	if (error)
> +	if (error) {
> +		kfree(priv);
>  		return error;
> +	}
> 
>  	if (set_properties) {
>  		psmouse->vendor = "ALPS";

Acked-by: Pali Rohár <pali.rohar@gmail.com>

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

      reply	other threads:[~2015-02-28 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 23:53 [PATCH] Input: ALPS - fix memory leak when detection fails Dmitry Torokhov
2015-02-28 11:04 ` Pali Rohár [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=201502281204.25691@pali \
    --to=pali.rohar@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).