diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2019-08-08 22:00:18 +0300 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2019-08-31 18:04:57 +0300 |
| commit | 7d82fcc9d9e81241778aaa22fda7be753e237d86 (patch) | |
| tree | e18408f71287ae2b9ace8a52ed6ad421157431c3 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 6f8c8f3c31015808100ee54fc471ff5dffdf1734 (diff) | |
| download | linux-7d82fcc9d9e81241778aaa22fda7be753e237d86.tar.xz | |
hwmon: (lm75) Fix write operations for negative temperatures
Writes into limit registers fail if the temperature written is negative.
The regmap write operation checks the value range, regmap_write accepts
an unsigned int as parameter, and the temperature value passed to
regmap_write is kept in a variable declared as long. Negative values
are converted large unsigned integers, which fails the range check.
Fix by type casting the temperature to u16 when calling regmap_write().
Cc: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
Fixes: e65365fed87f ("hwmon: (lm75) Convert to use regmap")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions
