Commit 987e8224 authored by xueqin Luo's avatar xueqin Luo Committed by Greg Kroah-Hartman
Browse files

wifi: mt76: mt7915: fix overflows seen when writing limit attributes



[ Upstream commit 64d57174 ]

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: 02ee68b9 ("mt76: mt7915: add control knobs for thermal throttling")
Signed-off-by: default avatarxueqin Luo <luoxueqin@kylinos.cn>
Link: https://patch.msgid.link/20241202031917.23741-3-luoxueqin@kylinos.cn


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b823e541
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment