u-boot/include/linux/usb
Stephan Gerhold 59310d1ecb usb: gadget: introduce 'enabled' flag in struct usb_ep
f_acm calls usb_ep_disable(f_acm->ep_notify) unconditionally in
acm_start_ctrl(), even if the USB endpoint was never enabled before. This
causes crashes for some UDC drivers (e.g. ci_udc), because they dereference
data structures that are assigned only after having called usb_ep_enable().

The f_acm driver in U-Boot is similar to the Linux driver, where this issue
does not occur because usb_ep_disable() and usb_ep_enable() internally
track the enabled state. In Linux this change was made in commit
b0bac2581c19 ("usb: gadget: introduce 'enabled' flag in struct usb_ep") by
Robert Baldyga.

Fix the crashes for f_acm by making the same change in U-Boot. This makes
the API less bug-prone and avoids introducing crashes when adapting new
gadget drivers from Linux.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://lore.kernel.org/r/20250407-acm-fixes-v1-3-e3dcb592d6d6@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-04-23 09:50:52 +02:00
..
at91_udc.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
atmel_usba_udc.h usb: gadget: atmel: Add DM_USB_GADGET support 2024-08-06 14:58:14 +02:00
cdc.h
ch9.h include: linux: Remove duplicate newlines 2024-07-29 15:01:04 -06:00
composite.h include: Drop <common.h> from include lists 2023-11-07 14:50:52 -05:00
dwc3-omap.h tree-wide: Replace http:// link with https:// link for ti.com 2023-11-10 11:01:50 -05:00
dwc3.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gadget.h usb: gadget: introduce 'enabled' flag in struct usb_ep 2025-04-23 09:50:52 +02:00
musb.h include: linux: Remove duplicate newlines 2024-07-29 15:01:04 -06:00
otg.h tree-wide: Replace http:// link with https:// link for ti.com 2023-11-10 11:01:50 -05:00
phy-rockchip-usbdp.h phy: rockchip: add usbdp combo phy driver 2023-07-28 18:45:02 +08:00
phy.h usb: add support for ULPI/SERIAL/HSIC PHY modes 2021-09-22 21:29:56 +02:00
usb_urb_compat.h usb: common: move urb code to common 2022-07-12 21:59:54 +02:00
xhci-fsl.h usb: xhci-fsl: Remove non-DM code 2022-06-28 17:03:31 -04:00
xhci-omap.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00