diff options
| author | Dan Carpenter <[email protected]> | 2025-05-28 08:11:09 +0000 |
|---|---|---|
| committer | Paolo Abeni <[email protected]> | 2025-05-29 10:37:42 +0000 |
| commit | 54d34165b4f786d7fea8412a18fb4a54c1eab623 (patch) | |
| tree | e2e2ff58e807ab4024d70ccfc146414aa8405e04 /drivers/fpga/tests/fpga-mgr-test.c | |
| parent | driver: net: ethernet: mtk_star_emac: fix suspend/resume issue (diff) | |
| download | kernel-54d34165b4f786d7fea8412a18fb4a54c1eab623.tar.gz kernel-54d34165b4f786d7fea8412a18fb4a54c1eab623.zip | |
net/mlx4_en: Prevent potential integer overflow calculating Hz
The "freq" variable is in terms of MHz and "max_val_cycles" is in terms
of Hz. The fact that "max_val_cycles" is a u64 suggests that support
for high frequency is intended but the "freq_khz * 1000" would overflow
the u32 type if we went above 4GHz. Use unsigned long long type for the
mutliplication to prevent that.
Fixes: 31c128b66e5b ("net/mlx4_en: Choose time-stamping shift value according to HW frequency")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-mgr-test.c')
0 files changed, 0 insertions, 0 deletions
