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 <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user