All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: ant.v.moryakov@gmail.com
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] drivers: usb: host: fix prevent memory leak in interrupt message submission
Date: Fri, 16 May 2025 12:31:53 -0600	[thread overview]
Message-ID: <20250516183153.GL100073@bill-the-cat> (raw)
In-Reply-To: <20250516175434.124221-1-ant.v.moryakov@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 979 bytes --]

On Fri, May 16, 2025 at 08:54:34PM +0300, ant.v.moryakov@gmail.com wrote:

> From: Anton Moryakov <ant.v.moryakov@gmail.com>
> 
> Ensure int_queue is properly destroyed when receiving wrong buffer
> by adding error handling path. Fixes memory leak that occurred
> when backbuffer validation failed.
> 
> Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
> ---
>  drivers/usb/host/ehci-hcd.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 7d5519c65a9..765d8b327ee 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -1557,6 +1557,7 @@ static int _ehci_submit_int_msg(struct usb_device *dev, unsigned long pipe,
>  		debug("got wrong buffer back (%p instead of %p)\n",
>  		      backbuffer, buffer);
>  		return -EINVAL;
> +		goto err;

A goto after return cannot be right, and should have had some compiler
warnings too.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2025-05-16 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 17:54 [PATCH] drivers: usb: host: fix prevent memory leak in interrupt message submission ant.v.moryakov
2025-05-16 18:31 ` Tom Rini [this message]
2025-05-16 18:57   ` Anton Moryakov
2025-05-16 19:11     ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2025-05-16 19:36 ant.v.moryakov
2025-05-16 19:59 ` Fabio Estevam
2025-05-16 20:04   ` Anton Moryakov
2025-05-16 17:50 ant.v.moryakov

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=20250516183153.GL100073@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=ant.v.moryakov@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.