Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'hwmon-for-linus-v4.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
"Couple of hwmon fixes:

Fix a potential ERR_PTR dereference in max31790 driver, and handle
temperature readings below 0 in adm9240 driver"

* tag 'hwmon-for-linus-v4.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (max31790) potential ERR_PTR dereference
hwmon: (adm9240) handle temperature readings below 0

+6 -4
+3 -3
drivers/hwmon/adm9240.c
··· 194 194 * 0.5'C per two measurement cycles thus ignore possible 195 195 * but unlikely aliasing error on lsb reading. --Grant 196 196 */ 197 - data->temp = ((i2c_smbus_read_byte_data(client, 197 + data->temp = (i2c_smbus_read_byte_data(client, 198 198 ADM9240_REG_TEMP) << 8) | 199 199 i2c_smbus_read_byte_data(client, 200 - ADM9240_REG_TEMP_CONF)) / 128; 200 + ADM9240_REG_TEMP_CONF); 201 201 202 202 for (i = 0; i < 2; i++) { /* read fans */ 203 203 data->fan[i] = i2c_smbus_read_byte_data(client, ··· 263 263 char *buf) 264 264 { 265 265 struct adm9240_data *data = adm9240_update_device(dev); 266 - return sprintf(buf, "%d\n", data->temp * 500); /* 9-bit value */ 266 + return sprintf(buf, "%d\n", data->temp / 128 * 500); /* 9-bit value */ 267 267 } 268 268 269 269 static ssize_t show_max(struct device *dev, struct device_attribute *devattr,
+3 -1
drivers/hwmon/max31790.c
··· 268 268 long *val) 269 269 { 270 270 struct max31790_data *data = max31790_update_device(dev); 271 - u8 fan_config = data->fan_config[channel]; 271 + u8 fan_config; 272 272 273 273 if (IS_ERR(data)) 274 274 return PTR_ERR(data); 275 + 276 + fan_config = data->fan_config[channel]; 275 277 276 278 switch (attr) { 277 279 case hwmon_pwm_input: