mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: "José Expósito" <jose.exposito89@gmail.com>
Cc: bentiss@kernel.org, lains@riseup.net,
	linux-input@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode()
Date: Tue, 4 Jun 2024 10:16:41 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2406041016330.16865@cbobk.fhfr.pm> (raw)
In-Reply-To: <20240524130600.275577-1-jose.exposito89@gmail.com>

On Fri, 24 May 2024, José Expósito wrote:

> Fix a memory leak on logi_dj_recv_send_report() error path.
> 
> Fixes: 6f20d3261265 ("HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()")
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> ---
>  drivers/hid/hid-logitech-dj.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
> index 3c3c497b6b91..37958edec55f 100644
> --- a/drivers/hid/hid-logitech-dj.c
> +++ b/drivers/hid/hid-logitech-dj.c
> @@ -1284,8 +1284,10 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
>  		 */
>  		msleep(50);
>  
> -		if (retval)
> +		if (retval) {
> +			kfree(dj_report);
>  			return retval;
> +		}
>  	}

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


      reply	other threads:[~2024-06-04  8:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 13:05 José Expósito
2024-06-04  8:16 ` 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.2406041016330.16865@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=bentiss@kernel.org \
    --cc=jose.exposito89@gmail.com \
    --cc=lains@riseup.net \
    --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

all inboxes | Powered by JetHome®