diff options
| author | Mattijs Korpershoek <[email protected]> | 2025-03-28 09:15:44 +0100 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2025-04-10 10:00:24 +0200 |
| commit | c76a7090f6480affbe3946fcd0dcc6df9bfe05b3 (patch) | |
| tree | e1b0a71bae1886ee4bf82b417cc8cd6098944967 /scripts/basic | |
| parent | 6c9eaec55ae634bac02e0cf70eb78c879d008a5c (diff) | |
usb: gadget: f_mass_storage: Fix memory leak of fsg buffers
In fsg_common_init, we allocate some buffers via memalign().
However, these buffers are never freed.
Because of that, we cannot call => ums command multiple times on boards
with low memory (CONFIG_SYS_MALLOC_LEN=0x81000):
=> ums 0 mmc 2
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0x3a3e000
|crq->brequest:0x0
CTRL+C - Operation aborted
=> ums 0 mmc 2
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0x3a3e000
failed to start <NULL>: -12
g_dnl_register: failed!, error: -12
g_dnl_register failed
Make sure the fsg buffers are freed when the gadget is unbound by
calling fsg_common_release() in fsg_unbind().
Reported-by: Zixun LI <[email protected]>
Signed-off-by: Mattijs Korpershoek <[email protected]>
Tested-by: Zixun LI <[email protected]> # on SAM9X60
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
