Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: host: Mark dwc->xhci as null if xhci probe fails
@ 2026-10-14 10:57 Prashanth K
  2026-10-14 11:07 ` sashiko-bot
  2026-10-14 11:17 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Prashanth K @ 2026-10-14 10:57 UTC (permalink / raw)
  To: Thinh Nguyen, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Prashanth K

Currently dwc->xhci is not cleared when xhci_plat_probe fails,
leading to null pointer dereference in dwc3_qcom_read_usb2_speed.
Mark the xhci pointer as NULL to prevent this.

Signed-off-by: Prashanth K <prashanth.k@oss.qualcomm.com>
---
 drivers/usb/dwc3/host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index c5674161b2b0..b01cf49454c2 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -219,6 +219,7 @@ int dwc3_host_init(struct dwc3 *dwc)
 	return 0;
 err:
 	platform_device_put(xhci);
+	dwc->xhci = NULL;
 	return ret;
 }
 EXPORT_SYMBOL_GPL(dwc3_host_init);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-14 11:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 10:57 [PATCH] usb: dwc3: host: Mark dwc->xhci as null if xhci probe fails Prashanth K
2026-10-14 11:07 ` sashiko-bot
2026-10-14 11:17 ` Greg Kroah-Hartman
2026-10-14 11:25   ` Prashanth K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox