mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 14:04:27 -04:00
net: phy: dp83640: clear state after PTP registration failure
dp83640_probe() publishes its per-PHY state through phydev before registering the PTP clock. If registration fails, the private data is freed while phydev->mii_ts and phydev->priv still point to it, and default_timestamp remains set. Clear the published PHY state and reset the PTP clock pointer before freeing the private data. Cc: stable+noautosel@kernel.org # untested fix to a driver init path Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn> Link: https://patch.msgid.link/20260811151345.73582-4-xuanqiang.luo@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
20663d78f1
commit
e8b166c1f0
@@ -1449,6 +1449,10 @@ static int dp83640_probe(struct phy_device *phydev)
|
||||
|
||||
no_register:
|
||||
clock->chosen = NULL;
|
||||
clock->ptp_clock = NULL;
|
||||
phydev->default_timestamp = false;
|
||||
phydev->mii_ts = NULL;
|
||||
phydev->priv = NULL;
|
||||
kfree(dp83640);
|
||||
no_memory:
|
||||
dp83640_clock_put(clock);
|
||||
|
||||
Reference in New Issue
Block a user