diff options
| author | Mattijs Korpershoek <[email protected]> | 2025-03-28 09:15:43 +0100 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2025-04-10 10:00:24 +0200 |
| commit | 6c9eaec55ae634bac02e0cf70eb78c879d008a5c (patch) | |
| tree | 212c4e238a403dd2df41e13a3a5eb914ca932d40 /scripts/basic | |
| parent | 47fd46db943a55a7e0232e27224d216b774d7575 (diff) | |
usb: gadget: f_mass_storage: Fix NULL dereference in fsg_add()
fsg_common_init() can fail when memory is low. In that case, it returns
PTR_ERR().
fsg_add() does not check for failure, and thus dereferences an invalid
fsg_common later, which crashes.
Verify if we receive an error from fsg_common_init() and handle it
gracefully.
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
