Commit cbefe2ff authored by Alexis Lothoré's avatar Alexis Lothoré Committed by Jakub Kicinski
Browse files

net: stmmac: make sure that ptp_rate is not 0 before configuring EST



If the ptp_rate recorded earlier in the driver happens to be 0, this
bogus value will propagate up to EST configuration, where it will
trigger a division by 0.

Prevent this division by 0 by adding the corresponding check and error
code.

Suggested-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: default avatarAlexis Lothoré <alexis.lothore@bootlin.com>
Fixes: 8572aec3 ("net: stmmac: Add basic EST support for XGMAC")
Link: https://patch.msgid.link/20250529-stmmac_tstamp_div-v4-2-d73340a794d5@bootlin.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 030ce919
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment