From: Prashanth K <prashanth.k@oss.qualcomm.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Prashanth K <prashanth.k@oss.qualcomm.com>
Subject: [PATCH] usb: dwc3: host: Mark dwc->xhci as null if xhci probe fails
Date: Wed, 14 Oct 2026 16:27:11 +0530 [thread overview]
Message-ID: <20261014105711.1708244-1-prashanth.k@oss.qualcomm.com> (raw)
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
next reply other threads:[~2026-10-14 10:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 10:57 Prashanth K [this message]
2026-10-14 11:17 ` Greg Kroah-Hartman
2026-10-14 11:25 ` Prashanth K
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261014105711.1708244-1-prashanth.k@oss.qualcomm.com \
--to=prashanth.k@oss.qualcomm.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®