summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <[email protected]>2026-04-28 16:37:33 +0800
committerFabio Estevam <[email protected]>2026-05-15 17:31:39 -0300
commit39f52b7c29e64233dae21c5aebd559b946665c77 (patch)
treeebf97bdeced45e6fc79721517c66fa2c6be05133
parentf745c1ab4eaaf16fe8b6df7c0a37c3068ad7331b (diff)
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 <[email protected]> Reviewed-by: Peng Fan <[email protected]>
-rw-r--r--drivers/net/phy/nxp-c45-tja11xx.c2
1 files changed, 1 insertions, 1 deletions
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;