Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: gadget: call usb_gadget_check_config() to verify UDC capability

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@kernel.org>
Reported-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20230707230015.494999-1-Frank.Li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Frank Li and committed by
Greg Kroah-Hartman
f4fc01af 609fded3

+4
+4
drivers/usb/gadget/composite.c
··· 1125 1125 goto done; 1126 1126 1127 1127 status = bind(config); 1128 + 1129 + if (status == 0) 1130 + status = usb_gadget_check_config(cdev->gadget); 1131 + 1128 1132 if (status < 0) { 1129 1133 while (!list_empty(&config->functions)) { 1130 1134 struct usb_function *f;