diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-09-17 12:44:55 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-09-17 12:44:55 +0200 |
commit | 41f71deda1c12e063a0793252021f37e790d1ef1 (patch) | |
tree | 62b54d6df170deaac38b5a4cb32d4e86d2118d8d /rust/helpers/usb.c | |
parent | 5db5025d32e5b0b4c13198b5570f33d92ae941d3 (diff) | |
parent | 08228941436047bdcd35a612c1aec0912a29d8cd (diff) |
Merge patch series "usb: gadget: Refactor function drivers to use __free() cleanup"
Kuen-Han Tsai <khtsai@google.com> says:
This patch series refactors the error-handling paths in the bind()
function for f_ncm, f_acm, f_ecm, and f_rndis drivers.
The current, unified goto logic in these drivers is vulnerable to a null
pointer dereference. This is caused by the cleanup logic incorrectly
handling the stale usb_request pointer after a bind/unbind cycle. This
series fixes this issue by converting the drivers to use the modern
__free() scope-based cleanup mechanism.
Patches 1-2 are preparatory, adding the endpoint pointer to struct
usb_request and defining helpers for the __free() cleanup. The remaining
four patches use this new plumbing to refactor each driver.
Future work
-----------
1. Refactor usb_ep_free_request(), usb_ep_queue(), and usb_ep_dequeue()
functions as the ep parameter becomes redudant.
2. Convert the remaining gadget function drivers to use the new __free()
cleanup mechanism.
Link: https://lore.kernel.org/r/20250916-ready-v1-0-4997bf277548@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/helpers/usb.c')
0 files changed, 0 insertions, 0 deletions