]> git.ipfire.org Git - people/arne_f/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:44:57 +0000 (19:44 +0100)
commit0138dfb7b3325dcd7347ccaa0c256c6fd9239b8d
tree303243b7353dd51cb854b67b731f4df0324ae538
parenta37706aca54c46b9ea11b3a53ea0e91e3ada1a22
hwmon: (lm80) fix a missing check of the status of SMBus read

[ Upstream commit c9c63915519b1def7043b184680f33c24cd49d7b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/lm80.c