From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18F49CCF2DF for ; Mon, 19 Jan 2026 11:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:To:Cc :Subject:From:Message-Id:Date:Content-Type:Content-Transfer-Encoding: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SaIzhehnPkbVpEfQQQ/RN2VRw7j9yZq/GRMnWoV7h4Y=; b=2HsABDUmlz4K8CAC3SKNvb7kfR SdKItfqz8WCPyMaTYIAh3D16KYEj9ARb6+cKU2ayhTcBRQAX+UP4lo/poWNZ100H5HDUthiDDgnT0 FtdxPBWxxMPxcoktHjMC0EdOqy40D8gKRac+q+lT/iw978CzLnRMuvvuycQ1iMwnAZ7fysq73OPQt LrZ3Ljq4U0jTWKDVId/AwiY8Jtt7V0CaepxlNPQsF1B2kS2i2bhtuKj8ys8kwOpWiDwrbZN9gpXdr fjqpwTFln3lrXsPuZMvWw5E+z1JuvxLMszt/tOvDTwnEyrp6cQvG71YkDRjh3zsxjpeoT73ZtcEBC Lu3r4DBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vhn7t-00000001rMq-1JJV; Mon, 19 Jan 2026 11:08:54 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vhn7p-00000001rKw-2tW8 for linux-arm-kernel@lists.infradead.org; Mon, 19 Jan 2026 11:08:51 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id C1F2E4E4216C; Mon, 19 Jan 2026 11:08:45 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8E04A60731; Mon, 19 Jan 2026 11:08:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 97D1E10B69897; Mon, 19 Jan 2026 12:08:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768820924; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=SaIzhehnPkbVpEfQQQ/RN2VRw7j9yZq/GRMnWoV7h4Y=; b=p3yEnQmjitO1+Cg+VsH0cQa38mXKu/02UZcrSkn5xu0gobhMeJqn4NTEPxqLmdXECWF/Lf 2dLIodnmFQentyhpNn9Jn3lJYs+EIIOs4UTAuPmwx52fz7jMMUqtOtQfOjmPJMEl0mQvY8 KgTlWzkKh6WTIgBQR1TPT1bpn9xxe5Q9MVJ8/OOGY6Dnnd7jRizoIkGmieS70Lon8Jp+J5 MjPx3hWXDvUlkjTGBPDjbTX+qoNTAxYhONFDQzQp8TYisPL3SM7jsNpi+6vrTVS2zq/3PV rBsBSgMdOISL8CsU2E/0Y76fmYo+xt7sc8MkeyyMacaXtM6A5Y56Yenb25pv0g== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 19 Jan 2026 12:08:40 +0100 Message-Id: From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH] usb: cdns3: host: Add null check for host_device before accessing its members Cc: , , , , , , To: "Abhash Kumar Jha" , , , X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260119082242.1922599-1-a-kumar2@ti.com> In-Reply-To: <20260119082242.1922599-1-a-kumar2@ti.com> X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260119_030850_104461_3AC21D23 X-CRM114-Status: GOOD ( 15.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Abhash, On Mon Jan 19, 2026 at 9:22 AM CET, Abhash Kumar Jha wrote: > In cases when the xhci device is not populated, we see a nullptr > exception when resuming. > > Add a nullptr check for the host_dev before accessing its private data. > > Fixes: 3a85c1011540 ("usb: host: cdns3: forward lost power information to= xhci") > Signed-off-by: Abhash Kumar Jha > --- > drivers/usb/cdns3/host.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c > index f0df114c2b53b..8cc7fc1de6193 100644 > --- a/drivers/usb/cdns3/host.c > +++ b/drivers/usb/cdns3/host.c > @@ -141,9 +141,12 @@ static void cdns_host_exit(struct cdns *cdns) > static int cdns_host_resume(struct cdns *cdns, bool power_lost) > { > struct usb_hcd *hcd =3D platform_get_drvdata(cdns->host_dev); > - struct xhci_plat_priv *priv =3D hcd_to_xhci_priv(hcd); > + struct xhci_plat_priv *priv; > =20 > - priv->power_lost =3D power_lost; > + if (hcd) { > + priv =3D hcd_to_xhci_priv(hcd); > + priv->power_lost =3D power_lost; > + } I am not seeing a codepath making it possible for drvdata to be NULL. Can you point it out? What HW, what config, etc. Thanks, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com