mirror-linux/drivers/usb/common
Guangshuo Li 01af542392 usb: ulpi: fix double free in ulpi_register_interface() error path
When device_register() fails, ulpi_register() calls put_device() on
ulpi->dev.

The device release callback ulpi_dev_release() drops the OF node
reference and frees ulpi, but the current error path in
ulpi_register_interface() then calls kfree(ulpi) again, causing a
double free.

Let put_device() handle the cleanup through ulpi_dev_release() and
avoid freeing ulpi again in ulpi_register_interface().

Fixes: 289fcff4bc ("usb: add bus type for USB ULPI")
Cc: stable <stable@kernel.org>
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20260401025142.1398996-1-lgs201920130244@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-04-02 09:36:56 +02:00
..
Kconfig Partially revert "usb: Kconfig: using select for USB_COMMON dependency" 2021-10-05 13:45:16 +02:00
Makefile
common.c usb: common: expand documentation for USB functions 2024-12-23 18:40:26 +01:00
common.h
debug.c usb: common: debug: Check non-standard control requests 2022-08-19 11:04:25 +02:00
led.c leds: Change led_trigger_blink[_oneshot]() delay parameters to pass-by-value 2023-05-25 12:16:27 +01:00
ulpi.c usb: ulpi: fix double free in ulpi_register_interface() error path 2026-04-02 09:36:56 +02:00
usb-conn-gpio.c usb: common: usb-conn-gpio: use a unique name for usb connector device 2025-04-11 16:08:34 +02:00
usb-otg-fsm.c usb: common: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:47 +02:00