aboutsummaryrefslogtreecommitdiff
path: root/lib/net_utils.c
diff options
context:
space:
mode:
authorDaniel Lezcano <[email protected]>2020-03-21 20:31:07 +0100
committerDaniel Lezcano <[email protected]>2020-03-23 15:20:47 +0100
commit40ea568593f20647e7d58deb7fcfa69b11a37d8b (patch)
treebafe1406cb9984cf802bd80e4731ea4c806f7026 /lib/net_utils.c
parentff44f672d74178b3be19d41a169b98b3e391d4ce (diff)
thermal/drivers/cpufreq_cooling: Remove abusing WARN_ON
The WARN_ON macros are used at the entry functions state2power() and set_cur_state(). state2power() is called with the max_state retrieved from get_max_state which returns cpufreq_cdev->max_level, then it check if max_state is > cpufreq_cdev->max_level. The test does not really makes sense but let's assume we want to make sure to catch an error if the code evolves. However the WARN_ON is overkill. set_cur_state() is also called from userspace if we write to the sysfs. It is easy to see a stack dumped by just writing to sysfs /sys/class/thermal/cooling_device0/cur_state a value greater than "max_level". A bit scary. Returing -EINVAL is enough. Remove these WARN_ON. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/net_utils.c')
0 files changed, 0 insertions, 0 deletions