From 39f52b7c29e64233dae21c5aebd559b946665c77 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Tue, 28 Apr 2026 16:37:33 +0800 Subject: [PATCH] net: phy: nxp-c45-tja11xx: Fix incorrect usage of devm_kzalloc devm_kzalloc needs to pass udevice for first parameter, this phy driver wrongly pass the priv in phy_device. And because the dev in phy_device is only valid after phy_connect, in probe phase this dev is NULL, so we can't use devm_kzalloc, replace it with kzalloc. Signed-off-by: Ye Li Reviewed-by: Peng Fan --- drivers/net/phy/nxp-c45-tja11xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c index a1e4c3d053b..9814ac498ed 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.c +++ b/drivers/net/phy/nxp-c45-tja11xx.c @@ -343,7 +343,7 @@ static int nxp_c45_probe(struct phy_device *phydev) { struct nxp_c45_phy *priv; - priv = devm_kzalloc(phydev->priv, sizeof(*priv), GFP_KERNEL); + priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM;