]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: Introduce free_usb_request helper
authorKuen-Han Tsai <khtsai@google.com>
Mon, 20 Oct 2025 16:20:32 +0000 (12:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:03:15 +0000 (14:03 +0100)
commitd44e82f46cd0e348837c31e629bf45d0dcabbe3b
tree1466e7d64352bad1a82dc99af574cd7d93a5f7f2
parent97fc7aa654e305a9a1826b2f94cc281fbc462cf7
usb: gadget: Introduce free_usb_request helper

[ Upstream commit 201c53c687f2b55a7cc6d9f4000af4797860174b ]

Introduce the free_usb_request() function that frees both the request's
buffer and the request itself.

This function serves as the cleanup callback for DEFINE_FREE() to enable
automatic, scope-based cleanup for usb_request pointers.

Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Link: https://lore.kernel.org/r/20250916-ready-v1-2-4997bf277548@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250916-ready-v1-2-4997bf277548@google.com
Stable-dep-of: 75a5b8d4ddd4 ("usb: gadget: f_ncm: Refactor bind path to use __free()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/usb/gadget.h