Skip to content

Commit 9d18fbf

Browse files
HoratiuVulturHari Prasath Gujulan Elango
authored andcommitted
net: micrel: Fix receiving the timestamp in the frame for lan8841
The blamed commit started to use the ptp workqueue to get the second part of the timestamp. And when the port was set down, then this workqueue is stopped. But if the config option NETWORK_PHY_TIMESTAMPING is not enabled, then the ptp_clock is not initialized so then it would crash when it would try to access the delayed work. So then basically by setting up and then down the port, it would crash. The fix consists in checking if the ptp_clock is initialized and only then cancel the delayed work. Fixes: cc75549 ("net: micrel: Change to receive timestamp in the frame for lan8841") Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: Hari Prasath Gujulan Elango <Hari.PrasathGE@microchip.com>
1 parent ed5bdb5 commit 9d18fbf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/net/phy/micrel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4580,7 +4580,8 @@ static int lan8841_suspend(struct phy_device *phydev)
45804580
struct kszphy_priv *priv = phydev->priv;
45814581
struct kszphy_ptp_priv *ptp_priv = &priv->ptp_priv;
45824582

4583-
ptp_cancel_worker_sync(ptp_priv->ptp_clock);
4583+
if (ptp_priv->ptp_clock)
4584+
ptp_cancel_worker_sync(ptp_priv->ptp_clock);
45844585

45854586
return genphy_suspend(phydev);
45864587
}

0 commit comments

Comments
 (0)