mirror-linux/drivers/usb/phy
Johan Hovold b4b64fda4d usb: phy: isp1301: fix non-OF device reference imbalance
A recent change fixing a device reference leak in a UDC driver
introduced a potential use-after-free in the non-OF case as the
isp1301_get_client() helper only increases the reference count for the
returned I2C device in the OF case.

Increment the reference count also for non-OF so that the caller can
decrement it unconditionally.

Note that this is inherently racy just as using the returned I2C device
is since nothing is preventing the PHY driver from being unbound while
in use.

Fixes: c84117912b ("USB: lpc32xx_udc: Fix error handling in probe")
Cc: stable@vger.kernel.org
Cc: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://patch.msgid.link/20251218153519.19453-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-12-23 15:48:46 +01:00
..
Kconfig usb: Remove orphaned UDC drivers 2025-04-11 16:11:25 +02:00
Makefile usb: Remove orphaned UDC drivers 2025-04-11 16:11:25 +02:00
of.c
phy-ab8500-usb.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
phy-am335x-control.c usb: phy: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:32 +02:00
phy-am335x-control.h
phy-am335x.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
phy-fsl-usb.c usb: phy: fsl-usb: Fix use-after-free in delayed work during device removal 2025-12-17 14:52:12 +01:00
phy-fsl-usb.h
phy-generic.c usb: phy: generic: Use proper helper for property detection 2025-02-03 16:39:56 +01:00
phy-generic.h
phy-gpio-vbus-usb.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
phy-isp1301.c usb: phy: isp1301: fix non-OF device reference imbalance 2025-12-23 15:48:46 +01:00
phy-keystone.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
phy-mv-usb.h
phy-mxs-usb.c usb: phy: mxs: silence EPROBE_DEFER error on boot 2025-02-03 16:29:15 +01:00
phy-omap-otg.c
phy-tahvo.c USB: phy: Use str_enable_disable-like helpers 2025-01-15 18:28:13 +01:00
phy-tegra-usb.c usb: phy: tegra: Remove unused functions 2025-06-19 12:26:32 +02:00
phy-twl6030-usb.c usb: phy: twl6030: Fix incorrect type for ret 2025-09-06 15:21:45 +02:00
phy-ulpi-viewport.c
phy-ulpi.c usb: ulpi: Remove unused otg_ulpi_create 2025-03-03 10:23:35 +01:00
phy.c usb: phy: Initialize struct usb_phy list_head 2025-11-26 12:58:46 +01:00