]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitc598b73b4f8a343ae3ec8b4ba614baefda0514a4
tree9c6f4c7ed81a15a69f403a62b1d6b2e1f4ac02d5
parent341382a7892f64cdfa7c3c1cb7aff54eb16799e6
hwmon: (lm80) fix a missing check of the status of SMBus read

BugLink: https://bugs.launchpad.net/bugs/1837664
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hwmon/lm80.c