diff options
author | Kuen-Han Tsai <khtsai@google.com> | 2025-09-16 16:21:32 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-09-17 12:44:53 +0200 |
commit | bfb1d99d969fe3b892db30848aeebfa19d21f57f (patch) | |
tree | 930018e3a346514def2a4b2d6569d57d7dc105ec /rust/helpers/usb.c | |
parent | 1b237f190eb3d36f52dffe07a40b5eb210280e00 (diff) |
usb: gadget: Store endpoint pointer in usb_request
Gadget function drivers often have goto-based error handling in their
bind paths, which can be bug-prone. Refactoring these paths to use
__free() scope-based cleanup is desirable, but currently blocked.
The blocker is that usb_ep_free_request(ep, req) requires two
parameters, while the __free() mechanism can only pass a pointer to the
request itself.
Store an endpoint pointer in the struct usb_request. The pointer is
populated centrally in usb_ep_alloc_request() on every successful
allocation, making the request object self-contained.
Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Link: https://lore.kernel.org/r/20250916-ready-v1-1-4997bf277548@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250916-ready-v1-1-4997bf277548@google.com
Diffstat (limited to 'rust/helpers/usb.c')
0 files changed, 0 insertions, 0 deletions