]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (lm80) fix a missing check of the status of SMBus read
authorKangjie Lu <kjlu@umn.edu>
Fri, 21 Dec 2018 19:01:33 +0000 (13:01 -0600)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 21 Dec 2018 23:37:56 +0000 (15:37 -0800)
commitc589a756180b878876af0477dc4fca095b36e377
tree893bd90f11a1ca968c1b73e86e410fbb1e2237b5
parent0a48b9246415803ad7d3375f9d80bb8821a4192f
hwmon: (lm80) fix a missing check of the status of SMBus read

If lm80_read_value() fails, it returns a negative number instead of the
correct read data. Therefore, we should avoid using the data if it
fails.

The fix checks if lm80_read_value() fails, and if so, returns with the
error number.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
[groeck: One variable for return values is enough]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm80.c