Re: [PATCH v6.6] net: stmmac: make sure that ptp_rate is not 0 before configuring EST

From: Greg KH
Date: Thu Jan 08 2026 - 10:43:36 EST


On Mon, Dec 29, 2025 at 08:31:17AM +0800, Rahul Sharma wrote:
> From: Alexis Lothoré <alexis.lothore@xxxxxxxxxxx>
>
> 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: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>
> Signed-off-by: Alexis Lothoré <alexis.lothore@xxxxxxxxxxx>
> Fixes: 8572aec3d0dc ("net: stmmac: Add basic EST support for XGMAC")
> Link: https://patch.msgid.link/20250529-stmmac_tstamp_div-v4-2-d73340a794d5@xxxxxxxxxxx
> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
> [ The context change is due to the commit c3f3b97238f6
> ("net: stmmac: Refactor EST implementation")
> which is irrelevant to the logic of this patch. ]
> Signed-off-by: Rahul Sharma <black.hawk@xxxxxxx>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 5 +++++
> drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 5 +++++
> 2 files changed, 10 insertions(+)

What is the git id of this commit in Linus's tree?

thanks,

greg k-h