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-v6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

- Fix refcount leak and NULL pointer access in coretemp driver

- Fix UAF in ibmpex driver

- Add missing pci_disable_device() to i5500_temp driver

- Fix calculation in ina3221 driver

- Fix temperature scaling in ltc2947 driver

- Check result of devm_kcalloc call in asus-ec-sensors driver

* tag 'hwmon-for-v6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (asus-ec-sensors) Add checks for devm_kcalloc
hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new()
hwmon: (coretemp) Check for null before removing sysfs attrs
hwmon: (ibmpex) Fix possible UAF when ibmpex_register_bmc() fails
hwmon: (i5500_temp) fix missing pci_disable_device()
hwmon: (ina3221) Fix shunt sum critical calculation
hwmon: (ltc2947) fix temperature scaling

+15 -5
+2
drivers/hwmon/asus-ec-sensors.c
··· 938 938 ec_data->nr_sensors = hweight_long(ec_data->board_info->sensors); 939 939 ec_data->sensors = devm_kcalloc(dev, ec_data->nr_sensors, 940 940 sizeof(struct ec_sensor), GFP_KERNEL); 941 + if (!ec_data->sensors) 942 + return -ENOMEM; 941 943 942 944 status = setup_lock_data(dev); 943 945 if (status) {
+8 -1
drivers/hwmon/coretemp.c
··· 242 242 */ 243 243 if (host_bridge && host_bridge->vendor == PCI_VENDOR_ID_INTEL) { 244 244 for (i = 0; i < ARRAY_SIZE(tjmax_pci_table); i++) { 245 - if (host_bridge->device == tjmax_pci_table[i].device) 245 + if (host_bridge->device == tjmax_pci_table[i].device) { 246 + pci_dev_put(host_bridge); 246 247 return tjmax_pci_table[i].tjmax; 248 + } 247 249 } 248 250 } 251 + pci_dev_put(host_bridge); 249 252 250 253 for (i = 0; i < ARRAY_SIZE(tjmax_table); i++) { 251 254 if (strstr(c->x86_model_id, tjmax_table[i].id)) ··· 535 532 static void coretemp_remove_core(struct platform_data *pdata, int indx) 536 533 { 537 534 struct temp_data *tdata = pdata->core_data[indx]; 535 + 536 + /* if we errored on add then this is already gone */ 537 + if (!tdata) 538 + return; 538 539 539 540 /* Remove the sysfs attributes */ 540 541 sysfs_remove_group(&pdata->hwmon_dev->kobj, &tdata->attr_group);
+1 -1
drivers/hwmon/i5500_temp.c
··· 117 117 u32 tstimer; 118 118 s8 tsfsc; 119 119 120 - err = pci_enable_device(pdev); 120 + err = pcim_enable_device(pdev); 121 121 if (err) { 122 122 dev_err(&pdev->dev, "Failed to enable device\n"); 123 123 return err;
+1
drivers/hwmon/ibmpex.c
··· 502 502 return; 503 503 504 504 out_register: 505 + list_del(&data->list); 505 506 hwmon_device_unregister(data->hwmon_dev); 506 507 out_user: 507 508 ipmi_destroy_user(data->user);
+2 -2
drivers/hwmon/ina3221.c
··· 228 228 * Shunt Voltage Sum register has 14-bit value with 1-bit shift 229 229 * Other Shunt Voltage registers have 12 bits with 3-bit shift 230 230 */ 231 - if (reg == INA3221_SHUNT_SUM) 231 + if (reg == INA3221_SHUNT_SUM || reg == INA3221_CRIT_SUM) 232 232 *val = sign_extend32(regval >> 1, 14); 233 233 else 234 234 *val = sign_extend32(regval >> 3, 12); ··· 465 465 * SHUNT_SUM: (1 / 40uV) << 1 = 1 / 20uV 466 466 * SHUNT[1-3]: (1 / 40uV) << 3 = 1 / 5uV 467 467 */ 468 - if (reg == INA3221_SHUNT_SUM) 468 + if (reg == INA3221_SHUNT_SUM || reg == INA3221_CRIT_SUM) 469 469 regval = DIV_ROUND_CLOSEST(voltage_uv, 20) & 0xfffe; 470 470 else 471 471 regval = DIV_ROUND_CLOSEST(voltage_uv, 5) & 0xfff8;
+1 -1
drivers/hwmon/ltc2947-core.c
··· 396 396 return ret; 397 397 398 398 /* in milidegrees celcius, temp is given by: */ 399 - *val = (__val * 204) + 550; 399 + *val = (__val * 204) + 5500; 400 400 401 401 return 0; 402 402 }