]> git.hungrycats.org Git - linux/commit
net: fec: only stop PTP if it was initialized
authorbui duc phuc <phucduc.bui@gmail.com>
Wed, 26 Aug 2026 10:34:28 +0000 (17:34 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:15 +0000 (13:36 +0200)
commit1f9639caeece703012bdb23975ebedf70f426269
treefd270cdae91608e83f6d3e37426d2d0af184313e
parentddbc5dc5a2e29b3934da09c1ba3c930fd8a40fd6
net: fec: only stop PTP if it was initialized

[ Upstream commit dd890ae29299636fb037276fc1b5238698d08b03 ]

fec_ptp_init() is only called when fep->bufdesc_ex is available.
However, fec_probe() unconditionally calls fec_ptp_stop() on the
failed_init path, and fec_drv_remove() unconditionally calls
fec_ptp_stop() during device removal.

Check fep->bufdesc_ex before calling fec_ptp_stop() in both paths
to avoid stopping PTP when it was not initialized.

Fixes: 32cba57ba74b ("net: fec: introduce fec_ptp_stop and use in probe fail path")
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260826103428.32807-1-phucduc.bui@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/fec_main.c