It seems that the two-byte temperature format is intended to be signed ("sp78" appears to mean "signed, decimal point, 7 bits before, 8 bits after") and it doesn't seem terribly plausible that we'll get any of these machines below freezing. It's probably more reasonable to assume that negative values indicate errors and drop them. Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx> --- drivers/hwmon/applesmc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index dbe3fa6..d7ec678 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -739,6 +739,10 @@ static ssize_t applesmc_show_temperature(struct device *dev, return ret; if (entry->len == 2) { + if (buffer[0] >= 0x80) { + /* The two byte format is signed - ignore negative */ + return -EINVAL; + } temp = buffer[0] * 1000; temp += (buffer[1] >> 6) * 250; } else { -- 1.7.3.3 _______________________________________________ lm-sensors mailing list lm-sensors@xxxxxxxxxxxxxx http://lists.lm-sensors.org/mailman/listinfo/lm-sensors