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)
committerJakub Kicinski <kuba@kernel.org>
Thu, 27 Aug 2026 19:41:14 +0000 (12:41 -0700)
commitdd890ae29299636fb037276fc1b5238698d08b03
tree0d4ff2c5b9f03e0551b74aa811a6ac5db5fc0262
parent23c53269f2baaedf2d92784290cb9ef6db2a3bce
net: fec: only stop PTP if it was initialized

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>
drivers/net/ethernet/freescale/fec_main.c