free_usb_request(9)
β¨ free_usb_request(9) β like, the kernel API manual bestie β¨
okay so welcome to the free_usb_request page from the Kernel API Manual β yes it's a whole manpage and yes it's short, but it's important, so sit with me for a sec π
πΈ NAME πΈ
free_usb_request β frees a usb_request object and its buffer. that's it. that's the whole job. and it slays at it π
π SYNOPSIS π
void free_usb_request (struct usb_request *req );
literally one call, no cap. <kbd> not needed here bestie, it's just C π«Ά
π¦ ARGUMENTS π¦
reqβ the request being freed. this is thestruct usb_request *you're handing over to be yeeted into the void π
β DESCRIPTION β
okay so here's the tea π β this helper function frees both the request's buffer and the request object itself, and it does that by calling usb_ep_free_request. two birds, one iconic little function β¨
its signature is designed to be used with DEFINE_FREE so you get automatic, scope-based cleanup for usb_request pointers. like, it cleans up after itself when it goes out of scope?? main character energy fr fr π no manual free-ing, no leaks, no stress β the vibe check is passed π
ngl this is the kind of function that makes you go "oh she's that girl" β scope-based cleanup is genuinely such a serve π₯
π SEE ALSO π
the whole extended friend group π β go read these next, iykyk:
- Kernel file
./include/linux/usb/gadget.h struct usb_request(9)struct usb_ep_caps(9)struct usb_ep(9)struct usb_gadget(9)usb_ep_align(9)usb_ep_align_maybe(9)gadget_is_altset_supported(9)gadget_is_stall_supported(9)gadget_is_zlp_supported(9)gadget_avoids_skb_reserve(9)gadget_is_dualspeed(9)gadget_is_superspeed(9)gadget_is_superspeed_plus(9)gadget_is_otg(9)struct usb_gadget_driver(9)usb_gadget_register_driver_owner(9)usb_gadget_unregister_driver(9)struct usb_string(9)struct usb_gadget_strings(9)usb_free_descriptors(9)
and that's the page!! πβ¨ππ¦πΈπ π«Ά
shoutout to the source file ./include/linux/usb, dated October 2026 β mwah, thanks for the lore, love u, bye bestie ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms