Skip to content

Commit 4dd5d4c

Browse files
thom24vinodkoul
authored andcommitted
phy: freescale: imx8qm-hsio: fix NULL pointer dereference
During the probe the refclk_pad pointer is set to NULL if the 'fsl,refclk-pad-mode' property is not defined in the devicetree node. But in imx_hsio_configure_clk_pad() this pointer is unconditionally used which could result in a NULL pointer dereference. So check the pointer before to use it. Fixes: 82c56b6 ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support") Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com> Link: https://patch.msgid.link/20260114-phy-fsl-imx8qm-hsio-fix-null-pointer-dereference-v1-1-730e941be464@bootlin.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent e2ce913 commit 4dd5d4c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/phy/freescale/phy-fsl-imx8qm-hsio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static void imx_hsio_configure_clk_pad(struct phy *phy)
251251
struct imx_hsio_lane *lane = phy_get_drvdata(phy);
252252
struct imx_hsio_priv *priv = lane->priv;
253253

254-
if (strncmp(priv->refclk_pad, "output", 6) == 0) {
254+
if (priv->refclk_pad && strncmp(priv->refclk_pad, "output", 6) == 0) {
255255
pll = true;
256256
regmap_update_bits(priv->misc, HSIO_CTRL0,
257257
HSIO_IOB_A_0_TXOE | HSIO_IOB_A_0_M1M0_MASK,

0 commit comments

Comments
 (0)