diff options
author | Jason Baron <jbaron@akamai.com> | 2020-08-21 19:20:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-03 12:29:27 +0300 |
commit | 3cea38246ad47a2cd95628d0c24936138313fec8 (patch) | |
tree | f5b9dfc2b8596d97afa8eb9537ae2b5ef8a9cb00 /include/clocksource/timer-ti-dm.h | |
parent | 4346396a717d85ac7409bf253a4c13f58dd5f9be (diff) | |
download | linux-3cea38246ad47a2cd95628d0c24936138313fec8.tar.xz |
hwmon: (nct7904) Correct divide by 0
[ Upstream commit 8aebbbb2d573d0b4afc08b90ac7d73dba2d9da97 ]
We hit a kernel panic due to a divide by 0 in nct7904_read_fan() for
the hwmon_fan_min case. Extend the check to hwmon_fan_input case as well
for safety.
[ 1656.545650] divide error: 0000 [#1] SMP PTI
[ 1656.545779] CPU: 12 PID: 18010 Comm: sensors Not tainted 5.4.47 #1
[ 1656.546065] RIP: 0010:nct7904_read+0x1e9/0x510 [nct7904]
...
[ 1656.546549] RAX: 0000000000149970 RBX: ffffbd6b86bcbe08 RCX: 0000000000000000
...
[ 1656.547548] Call Trace:
[ 1656.547665] hwmon_attr_show+0x32/0xd0 [hwmon]
[ 1656.547783] dev_attr_show+0x18/0x50
[ 1656.547898] sysfs_kf_seq_show+0x99/0x120
[ 1656.548013] seq_read+0xd8/0x3e0
[ 1656.548127] vfs_read+0x89/0x130
[ 1656.548234] ksys_read+0x7d/0xb0
[ 1656.548342] do_syscall_64+0x48/0x110
[ 1656.548451] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: d65a5102a99f5 ("hwmon: (nct7904) Convert to use new hwmon registration API")
Signed-off-by: Jason Baron <jbaron@akamai.com>
Link: https://lore.kernel.org/r/1598026814-2604-1-git-send-email-jbaron@akamai.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/clocksource/timer-ti-dm.h')
0 files changed, 0 insertions, 0 deletions