Commit d6dab7dd authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

hwmon: Fix PCI device reference leak in quirk

Thankfully this only affects systems with one specific south bridge
and is most probably harmless unless the hwmon module is heavily
cycled.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 752451f0
...@@ -84,19 +84,21 @@ static void __init hwmon_pci_quirks(void) ...@@ -84,19 +84,21 @@ static void __init hwmon_pci_quirks(void)
/* Open access to 0x295-0x296 on MSI MS-7031 */ /* Open access to 0x295-0x296 on MSI MS-7031 */
sb = pci_get_device(PCI_VENDOR_ID_ATI, 0x436c, NULL); sb = pci_get_device(PCI_VENDOR_ID_ATI, 0x436c, NULL);
if (sb && if (sb) {
(sb->subsystem_vendor == 0x1462 && /* MSI */ if (sb->subsystem_vendor == 0x1462 && /* MSI */
sb->subsystem_device == 0x0031)) { /* MS-7031 */ sb->subsystem_device == 0x0031) { /* MS-7031 */
pci_read_config_byte(sb, 0x48, &enable);
pci_read_config_byte(sb, 0x48, &enable); pci_read_config_word(sb, 0x64, &base);
pci_read_config_word(sb, 0x64, &base);
if (base == 0 && !(enable & BIT(2))) {
if (base == 0 && !(enable & BIT(2))) { dev_info(&sb->dev,
dev_info(&sb->dev, "Opening wide generic port at 0x295\n");
"Opening wide generic port at 0x295\n"); pci_write_config_word(sb, 0x64, 0x295);
pci_write_config_word(sb, 0x64, 0x295); pci_write_config_byte(sb, 0x48,
pci_write_config_byte(sb, 0x48, enable | BIT(2)); enable | BIT(2));
}
} }
pci_dev_put(sb);
} }
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment