Re: [PATCH 2/2] usb: gadget: f_loopback: Use auto-cleanup for usb_request
From: Greg Kroah-Hartman
Date: Thu Oct 30 2025 - 11:34:25 EST
On Thu, Oct 30, 2025 at 11:14:20PM +0800, Kuen-Han Tsai wrote:
> Refactor f_loopback.c to use auto-cleanup mechanism for usb_request
> allocations in alloc_requests().
>
> The shared buffer between in_req and out_req is handled by nullifying
> in_req->buf before returning on usb_ep_queue failure, ensuring the
> buffer is only freed once by the out_req cleanup.
Same here, it's tricky stuff, and you are only saving 4 lines of code?
Not really worth it I would think.
thanks,
greg k-h