U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Zixun LI <admin@hifiphile.com>
Cc: Marek Vasut <marex@denx.de>, Lukasz Majewski <lukma@denx.de>,
	Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de
Subject: Re: usb:composite: data abort on second ums launch
Date: Fri, 28 Mar 2025 09:20:34 +0100	[thread overview]
Message-ID: <87wmc98t2l.fsf@baylibre.com> (raw)
In-Reply-To: <8734eya8no.fsf@baylibre.com>

Hi Zixun,

On jeu., mars 27, 2025 at 14:46, Mattijs Korpershoek <mkorpershoek@baylibre.com> wrote:

> Hi Zixun, Marek,
>
> On lun., mars 24, 2025 at 18:40, Mattijs Korpershoek <mkorpershoek@baylibre.com> wrote:
>
>> Hi Zixun,
>>
>> On lun., mars 24, 2025 at 18:33, Zixun LI <admin@hifiphile.com> wrote:
>>
>> resetting ...
>
> [...]
>
>>
>>>
>>> Each time when ums is called 2*FSG_BUFLEN, 256kB buffer is allocated
>>> and it seems not
>>> freed as fsg_common_release() is not called.
>
> There are quite a few things that are wrong in
> drivers/usb/gadget/f_mass_storage.c
>
> 1. The "Synchronous Abort" exception happens because we call
>    kfree(common->luns); and common->luns is not allocated via
>    malloc/kmalloc.
>
> 2. We use a kref member that's unused and can be removed
>
> 3. There is a memory leak (as reported by Zixun) when unbind() is
>    called. We should call fsg_common_release().
>
> I will send a series to fix this.

Series send out here:
https://lore.kernel.org/u-boot/20250328-ums-gadget-leak-v1-0-3b677db99bde@baylibre.com

Available on patchwork:
https://patchwork.ozlabs.org/project/uboot/patch/20250328-ums-gadget-leak-v1-0-3b677db99bde@baylibre.com/

If you could have a look and test it yourself, that would be greatly
appreciated.

If doing so, you can reply to the above thread with: "Tested-by: Name <email>"

>
> Zixun, thanks again for reporting this and helping me reproduce!
>
> Mattijs
>
>>>
>>> Zixun

      reply	other threads:[~2025-03-28  8:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24 10:42 usb:composite: data abort on second ums launch Zixun LI
2025-03-24 14:03 ` Marek Vasut
2025-03-24 15:18   ` Zixun LI
2025-03-24 17:21   ` Mattijs Korpershoek
2025-03-24 17:33     ` Zixun LI
2025-03-24 17:40       ` Mattijs Korpershoek
2025-03-27 13:46         ` Mattijs Korpershoek
2025-03-28  8:20           ` Mattijs Korpershoek [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=87wmc98t2l.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=admin@hifiphile.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=trini@konsulko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox