zephyr/drivers/usb/device
Tomasz Moń 0d4aa49766 drivers: usb_dc_nrfx: Do not uninit endpoints on detach
Sometimes it is desired for the USB device to detach and reattach itself
to the host. USB device controller driver interface supports detach with
usb_dc_detach() function. Subsequently the device can be reattached to
the bus by calling usb_dc_attach().

USB device stack sets the control transfer callbacks in usb_enable().
Nordic usb_dc_detach() implementation inadvertedly overwrote registered
callbacks with zeroes by clearing endpoint configuration structure. This
lead to a NULL pointer dereference during enumeration after device has
reattached inself to the host.

Preserve the callbacks by removing the eps_ctx_uninit() function.
Endpoints runtime data is initialized in usb_dc_attach() so this should
pose no problems.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-09-21 12:56:39 +02:00
..
CMakeLists.txt drivers: usb: Add RP2040 USB device support. 2022-05-13 16:28:27 +02:00
Kconfig drivers: usb: mcux: Restructure driver for SDK updates 2022-09-09 09:44:46 -05:00
usb_dc_dw.c include: add more missing zephyr/ prefixes 2022-05-27 15:20:27 -07:00
usb_dc_kinetis.c drivers: usb_dc_kinetis: set thread name 2022-09-02 11:00:48 +00:00
usb_dc_mcux.c drivers: usb: mcux: Restructure driver for SDK updates 2022-09-09 09:44:46 -05:00
usb_dc_native_posix_adapt.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
usb_dc_native_posix_adapt.h
usb_dc_native_posix.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
usb_dc_nrfx.c drivers: usb_dc_nrfx: Do not uninit endpoints on detach 2022-09-21 12:56:39 +02:00
usb_dc_rpi_pico.c drivers: usb_dc_rpi: set thread name 2022-09-02 11:00:48 +00:00
usb_dc_sam0.c drivers: usb: usb_dc_sam0: fix memory leak 2022-09-19 15:20:53 -05:00
usb_dc_sam_usbc.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
usb_dc_sam_usbhs.c driver: usb_dc_sam_usbhs: Initialize Endpoint FIFO 2022-09-09 16:31:43 -04:00
usb_dc_stm32.c devices: constify device pointers initialized at compile time 2022-08-22 17:08:26 +02:00
usb_dw_registers.h drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00