aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/event_analyzing_sample.py
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-01-21 14:55:43 +0300
committerGuenter Roeck <linux@roeck-us.net>2022-01-23 18:21:27 -0800
commitc1ec0cabc36718efc7fe8b4157d41b82d08ec1d2 (patch)
treeb5d6310739692d7f6154ac877405c3a434ff79d2 /tools/perf/scripts/python/event_analyzing_sample.py
parentf1e75e0d6a1ae02fa4189d7aeebab623bade2a21 (diff)
hwmon: (adt7470) Prevent divide by zero in adt7470_fan_write()
The "val" variable is controlled by the user and comes from hwmon_attr_store(). The FAN_RPM_TO_PERIOD() macro divides by "val" so a zero will crash the system. Check for that and return -EINVAL. Negatives are also invalid so return -EINVAL for those too. Fixes: fc958a61ff6d ("hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions