diff options
| author | 2019-07-11 10:44:48 +0800 | |
|---|---|---|
| committer | 2019-07-21 19:18:45 -0700 | |
| commit | 211186cae14de09573b062e478eb9fe215aed8d9 (patch) | |
| tree | 9c56f175357aa288925d6f09925182832c510599 /include/linux/phy/git:/ssh:/git@git.zx2c4.com | |
| parent | Linus 5.3-rc1 (diff) | |
| download | linux-dev-211186cae14de09573b062e478eb9fe215aed8d9.tar.xz linux-dev-211186cae14de09573b062e478eb9fe215aed8d9.zip | |
hwmon: (occ) Fix division by zero issue
The code in occ_get_powr_avg() invokes div64_u64() without checking the
divisor. In case the divisor is zero, kernel gets an "Division by zero
in kernel" error.
Check the divisor and make it return 0 if the divisor is 0.
Fixes: c10e753d43eb ("hwmon (occ): Add sensor types and versions")
Signed-off-by: Lei YU <mine260309@gmail.com>
Reviewed-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/1562813088-23708-1-git-send-email-mine260309@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/phy/git:/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
