[PATCH] net: ethernet: ti: Prevent divide-by-zero in cpts_calc_mult_shift()

Vadim Fedorenko vadim.fedorenko at linux.dev
Thu Aug 28 05:05:55 PDT 2025


On 28/08/2025 10:22, Miaoqian Lin wrote:
> cpts_calc_mult_shift() has a potential divide-by-zero in this line:
> 
>          do_div(maxsec, freq);
> 
> due to the fact that clk_get_rate() can return zero in certain error
> conditions.

Have you seen this happening in the real environment, or is it just
analysis of the code? I don't see a reason for these "certain error
conditions" to happen...



More information about the Linux-mediatek mailing list