realtek: pcs: Fix overflow in rtpcs_930x_sds_clock_wait
authorSven Eckelmann <[email protected]>
Sun, 23 Nov 2025 14:25:05 +0000 (15:25 +0100)
committerHauke Mehrtens <[email protected]>
Mon, 24 Nov 2025 23:28:50 +0000 (00:28 +0100)
commitd5fec0b125a31c148cf398b5106d49f361bd377b
tree9cff9ece50c205d14acdf25b897e2b27d5f4365e
parent69c6658c73113163bd3680db60ed45433f9fe15f
realtek: pcs: Fix overflow in rtpcs_930x_sds_clock_wait

It can happen that the calculation `start + (HZ / 1000) * timeout`
overflows `unsigned long`. This must be handled correctly to avoid too long
waits. Luckily, the `time_before()` helper already does this.

Signed-off-by: Sven Eckelmann <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c