mbox series

[-next,0/2] *** fix overflows seen when writing limit attributes ***

Message ID 20241202031917.23741-1-luoxueqin@kylinos.cn (mailing list archive)
Headers show
Series *** fix overflows seen when writing limit attributes *** | expand

Message

xueqin Luo Dec. 2, 2024, 3:19 a.m. UTC
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(-)