This is a note to let you know that I've just added the patch titled usb: gadget: call usb_gadget_check_config() to verify UDC capability to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-gadget-call-usb_gadget_check_config-to-verify-udc-capability.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f4fc01af5b640bc39bd9403b5fd855345a2ad5f8 Mon Sep 17 00:00:00 2001 From: Frank Li <Frank.Li@xxxxxxx> Date: Fri, 7 Jul 2023 19:00:14 -0400 Subject: usb: gadget: call usb_gadget_check_config() to verify UDC capability From: Frank Li <Frank.Li@xxxxxxx> commit f4fc01af5b640bc39bd9403b5fd855345a2ad5f8 upstream. The legacy gadget driver omitted calling usb_gadget_check_config() to ensure that the USB device controller (UDC) has adequate resources, including sufficient endpoint numbers and types, to support the given configuration. Previously, usb_add_config() was solely invoked by the legacy gadget driver. Adds the necessary usb_gadget_check_config() after the bind() operation to fix the issue. Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to composite EP number") Cc: stable <stable@xxxxxxxxxx> Reported-by: Ravi Gunasekaran <r-gunasekaran@xxxxxx> Signed-off-by: Frank Li <Frank.Li@xxxxxxx> Link: https://lore.kernel.org/r/20230707230015.494999-1-Frank.Li@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/gadget/composite.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1029,6 +1029,10 @@ int usb_add_config(struct usb_composite_ goto done; status = bind(config); + + if (status == 0) + status = usb_gadget_check_config(cdev->gadget); + if (status < 0) { while (!list_empty(&config->functions)) { struct usb_function *f; Patches currently in stable-queue which might be from Frank.Li@xxxxxxx are queue-6.1/usb-cdns3-fix-incorrect-calculation-of-ep_buf_size-when-more-than-one-config.patch queue-6.1/usb-gadget-call-usb_gadget_check_config-to-verify-udc-capability.patch