Re: [PATCH v2] hwmon: (lm80) fix a missing check of the status of SMBus read

2018-12-21 Thread Guenter Roeck
On Fri, Dec 21, 2018 at 01:01:33PM -0600, Kangjie Lu wrote: > 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

[PATCH v2] hwmon: (lm80) fix a missing check of the status of SMBus read

2018-12-21 Thread Kangjie Lu
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 --- drivers/hwmon/lm80.c | 8 ++--