DIV_ROUND_CLOSEST() after kstrtoul() results in an overflow if a large number such as 18446744073709551615 is provided by the user. Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations. This commit was inspired by commit: 57ee12b6c514. xueqin Luo (2): wifi: mt76: mt7996: fix overflows seen when writing limit attributes mt76: mt7915: fix overflows seen when writing limit attributes drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.34.1