linux/drivers/usb/gadget/udc
Myeonghun Pak 886338ea7d usb: gadget: snps_udc_plat: clean up PHY on probe deferral
When the referenced extcon device has not registered yet,
extcon_get_edev_by_phandle() returns -EPROBE_DEFER after the driver has
initialized and powered on the PHY. The direct return bypasses the common
cleanup path and leaves both operations unbalanced.

Store the lookup error first and route deferred probing through exit_phy,
while retaining the existing behavior of suppressing the error message for
deferral.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 1b9f35adb0 ("usb: gadget: udc: Add Synopsys UDC Platform driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260804140510.37639-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-08-14 10:48:50 +09:00
..
aspeed-vhub driver core: Replace dev->of_node_reused with dev_of_node_reused() 2026-04-26 23:50:20 +02:00
bdc usb: gadget: udc: bdc: free IRQ and drain func_wake_notify before teardown 2026-07-13 07:10:11 +02:00
cdns2 treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
amd5536udc_pci.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
amd5536udc.h USB: gadget: udc: Remove some dead code 2021-10-10 15:12:34 +02:00
aspeed_udc.c usb: gadget: aspeed_udc: check endpoint DMA allocation 2026-07-10 15:14:51 +02:00
at91_udc.c usb: gadget: at91_udc: drain polled-VBUS timer/work before udc is freed 2026-08-14 10:48:27 +09:00
at91_udc.h usb: gadget: at91_udc: Convert to GPIO descriptors 2021-11-17 14:41:15 +01:00
atmel_usba_udc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
atmel_usba_udc.h usb: gadget: udc: atmel: update endpoint allocation for sam9x60 2020-09-24 11:56:17 +03:00
bcm63xx_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
core.c usb: gadget: udc: Fix use-after-free in gadget_match_driver 2026-07-08 13:35:42 +02:00
dummy_hcd.c usb: gadget: dummy_hcd: prevent fifo_req reuse during giveback 2026-07-16 17:12:36 +02:00
fsl_qe_udc.c usb: fsl_qe_udc: check qe_alloc_request() failure in ch9getstatus() 2026-07-10 15:14:28 +02:00
fsl_qe_udc.h
fsl_udc_core.c USB: gadget: fsl-udc: drop misleading unbind sanity check 2026-07-13 07:10:11 +02:00
fsl_usb2_udc.h USB: gadget: fsl-udc: fix dev_printk() device 2026-07-13 07:10:11 +02:00
goku_udc.c usb: gadget: goku_udc: avoid NULL deref of dev->driver in INT_USBRESET log 2026-05-22 11:34:41 +02:00
goku_udc.h
gr_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
gr_udc.h USB: gr_udc: remove dentry storage for debugfs file 2021-06-02 16:41:00 +02:00
Kconfig USB: gadget: fsl-udc: enable compile testing 2026-07-10 15:56:29 +02:00
lpc32xx_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
m66592-udc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
m66592-udc.h
Makefile usb: Remove orphaned UDC drivers 2025-04-11 16:11:25 +02:00
max3420_udc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
net2280.c usb: gadget: net2280: Fix double free in probe error path 2026-05-22 10:35:22 +02:00
net2280.h USB: UDC: Implement udc_async_callbacks in net2280 2021-06-04 13:52:06 +02:00
omap_udc.c USB: omap_udc: DMA: Don't enable burst 4 mode 2026-04-27 09:49:28 -06:00
omap_udc.h
pch_udc.c usb: gadget: pch_udc: remove excess kernel-doc member for registered 2026-07-10 15:56:00 +02:00
pxa25x_udc.c usb: udc: pxa: remove unused platform_data 2026-04-27 10:18:19 -06:00
pxa25x_udc.h usb: udc: pxa: remove unused platform_data 2026-04-27 10:18:19 -06:00
pxa27x_udc.c usb: udc: pxa: fix error handling 2026-07-13 07:10:10 +02:00
pxa27x_udc.h usb: udc: pxa: remove unused platform_data 2026-04-27 10:18:19 -06:00
r8a66597-udc.c usb: gadget: r8a66597: avoid double free of ep0_req in probe error path 2026-07-08 17:07:25 +02:00
r8a66597-udc.h
renesas_usb3.c usb: gadget: renesas_usb3: validate endpoint index in standard request handlers 2026-04-07 13:48:30 +02:00
renesas_usbf.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
rzv2m_usb3drd.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
snps_udc_core.c USB: gadget: snps-udc: fix device name leak on probe failure 2026-07-13 07:10:11 +02:00
snps_udc_plat.c usb: gadget: snps_udc_plat: clean up PHY on probe deferral 2026-08-14 10:48:50 +09:00
tegra-xudc.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
trace.c USB: gadget: udc: fix kernel-doc syntax in file headers 2021-05-24 15:27:03 +02:00
trace.h usb: udc: Add trace event for usb_gadget_set_state 2025-09-12 14:03:14 +02:00
udc-xilinx.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00