]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: phy: nxp-c45-tja11xx: Fix incorrect usage of devm_kzalloc
authorYe Li <ye.li@nxp.com>
Tue, 28 Apr 2026 08:37:33 +0000 (16:37 +0800)
committerFabio Estevam <festevam@gmail.com>
Fri, 15 May 2026 20:31:39 +0000 (17:31 -0300)
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 <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/net/phy/nxp-c45-tja11xx.c

index a1e4c3d053b669c39d78affe8f04d85af3d6e3c6..9814ac498ed04629851e4c5db94c961f5f1acfcd 100644 (file)
@@ -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;