linux-yocto/drivers/usb/gadget
Kuen-Han Tsai dec7774d0e Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io"
commit f6c7bc4a68 upstream.

This reverts commit ffd603f214.

Commit ffd603f214 ("usb: gadget: u_serial: Add null pointer check in
gs_start_io") adds null pointer checks at the beginning of the
gs_start_io() function to prevent a null pointer dereference. However,
these checks are redundant because the function's comment already
requires callers to hold the port_lock and ensure port.tty and port_usb
are not null. All existing callers already follow these rules.

The true cause of the null pointer dereference is a race condition. When
gs_start_io() calls either gs_start_rx() or gs_start_tx(), the port_lock
is temporarily released for usb_ep_queue(). This allows port.tty and
port_usb to be cleared.

Fixes: ffd603f214 ("usb: gadget: u_serial: Add null pointer check in gs_start_io")
Cc: stable <stable@kernel.org>
Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Reviewed-by: Prashanth K <prashanth.k@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250617050844.1848232-1-khtsai@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-17 18:35:14 +02:00
..
function Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io" 2025-07-17 18:35:14 +02:00
legacy
udc usb: gadget: tegra-xudc: ACK ST_RC after clearing CTRL_RUN 2025-05-18 08:24:08 +02:00
composite.c usb: gadget: Use get_status callback to set remote wakeup capability 2025-05-18 08:24:09 +02:00
config.c
configfs.c usb: gadget: configfs: Ignore trailing LF for user strings to cdev 2025-01-17 13:36:22 +01:00
configfs.h
epautoconf.c
functions.c
Kconfig usb: gadget: midi2: Reverse-select at the right place 2025-01-17 13:36:22 +01:00
Makefile
u_f.c
u_f.h
u_os_desc.h
usbstring.c