Skip to content

Commit

Permalink
hwmon: (nct6775) Additional check for ChipID before ASUS WMI usage
Browse files Browse the repository at this point in the history
WMI monitoring methods can be changed or removed in new ASUS boards
BIOS versions. Such versions return zero instead of a real one as
Chip ID.

Commit adds additional validation for the result of Chip ID call
before enabling access by ASUS WMI methods.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807
Signed-off-by: Denis Pauk <pauk.denis@gmail.com>
Link: https://lore.kernel.org/r/20211218205206.615865-1-pauk.denis@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Denis Pauk authored and Guenter Roeck committed Dec 26, 2021
1 parent a8d6d49 commit 20f2e67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
Expand Up @@ -5038,7 +5038,7 @@ static int __init sensors_nct6775_init(void)
board_name);
if (err >= 0) {
/* if reading chip id via WMI succeeds, use WMI */
if (!nct6775_asuswmi_read(0, NCT6775_PORT_CHIPID, &tmp)) {
if (!nct6775_asuswmi_read(0, NCT6775_PORT_CHIPID, &tmp) && tmp) {
pr_info("Using Asus WMI to access %#x chip.\n", tmp);
access = access_asuswmi;
} else {
Expand Down

0 comments on commit 20f2e67

Please sign in to comment.