From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A180E1F09B3 for ; Mon, 23 Feb 2026 16:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862817; cv=none; b=C3TXLxn3r5k0MDT1XJNNTBOePofgMEC2aRK7s00rMjWU0Qgn95BgWG8EmH+HNKxVjPyKjCmh1GrYwYFJ5fticZ2/XZ2Q67OmWdHiVt+Wds56Wi7gIw++kEZMvodqXfribOSW3vbAatvPuz0j1kjJEBlwNL0IrQWRoxv8uIjOqvA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862817; c=relaxed/simple; bh=AuHj++y9AXQn17YIe0Yz23jzmAe5YfU+cSYfahBwqmo=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=J8QeaPlQs1CQUBiFg1mqWca32eiV/XZ8Mw5VNx4nR5jy0C96M4l06KlTkf8RrPu/QvFMUiee/GXp3LCXo36eb8MmCSDV2M8hPq/9XZb+SOoLFxyYUt5DXXvuw6/JU9CtOKsqTpmttgrF3PH3kqJmGRtzlMm85tuv7TnJZTQ8zXo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vuYSS-0006bz-TA; Mon, 23 Feb 2026 17:06:52 +0100 Received: from lupine.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::4e] helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vuYSQ-002G8q-30; Mon, 23 Feb 2026 17:06:52 +0100 Received: from pza by lupine with local (Exim 4.98.2) (envelope-from ) id 1vuYSS-00000000Kn3-0qZ9; Mon, 23 Feb 2026 17:06:52 +0100 Message-ID: <23f78ee620644c12d4e3912fd72de35dccf04373.camel@pengutronix.de> Subject: Re: [PATCH] reset: rzg2l-usbphy-ctrl: Check pwrrdy is valid before using it From: Philipp Zabel To: Claudiu , biju.das.jz@bp.renesas.com Cc: linux-kernel@vger.kernel.org, Claudiu Beznea Date: Mon, 23 Feb 2026 17:06:51 +0100 In-Reply-To: <20260204133427.3762840-1-claudiu.beznea.uj@bp.renesas.com> References: <20260204133427.3762840-1-claudiu.beznea.uj@bp.renesas.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-0+deb13u1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Mi, 2026-02-04 at 15:34 +0200, Claudiu wrote: > From: Claudiu Beznea >=20 > The pwrrdy regmap_filed is allocated in rzg2l_usbphy_ctrl_pwrrdy_init() > only if the driver data is set to RZG2L_USBPHY_CTRL_PWRRDY. Check that > pwrrdy is valid before using it to avoid "Unable to handle kernel NULL > pointer dereference at virtual address" errors. >=20 > Fixes: c5b7cd9adefc ("reset: rzg2l-usbphy-ctrl: Add suspend/resume suppor= t") > Signed-off-by: Claudiu Beznea > --- > drivers/reset/reset-rzg2l-usbphy-ctrl.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/rese= t-rzg2l-usbphy-ctrl.c > index 32bc268c9149..05dd9b4a02df 100644 > --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c > +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c > @@ -136,6 +136,9 @@ static int rzg2l_usbphy_ctrl_set_pwrrdy(struct regmap= _field *pwrrdy, > { > u32 val =3D power_on ? 0 : 1; > =20 > + if (!pwrrdy) > + return 0; > + > /* The initialization path guarantees that the mask is 1 bit long. */ > return regmap_field_update_bits(pwrrdy, 1, val); > } Applied to reset/fixes, thanks! [1/1] reset: rzg2l-usbphy-ctrl: Check pwrrdy is valid before using it https://git.pengutronix.de/cgit/pza/linux/commit/?id=3De0cf84109bc6 regards Philipp