wifi: mt76: mt7996: fix overflows seen when writing limit attributes
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: 57ee12b6. Fixes: 6879b2e9 ("wifi: mt76: mt7996: add thermal sensor device support") Signed-off-by:xueqin Luo <luoxueqin@kylinos.cn> Link: https://patch.msgid.link/20241202031917.23741-2-luoxueqin@kylinos.cn Signed-off-by:
Felix Fietkau <nbd@nbd.name>
Loading
Please sign in to comment