Skip to contentSkip to conversation

cpufreq: nforce2: fix PCI device reference leaks in nforce2_fsb_read

PATCH In review Miaoqian Lin 2 participants 2 messages Sep 2, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: nforce2: fix PCI device reference leaks in nforce2_fsb_read

Add missing pci_dev_put() calls to release device references obtained via pci_get_subsys().

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 drivers/cpufreq/cpufreq-nforce2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/cpufreq/cpufreq-nforce2.c +4 -1
index fedad1081973..0a49cb9d7ba1 100644
@@ -148,13 +148,16 @@ static unsigned int nforce2_fsb_read(int bootfsb)
 	/* Check if PLL register is already set */
 	pci_read_config_byte(nforce2_dev, NFORCE2_PLLENABLE, (u8 *)&temp);
 
-	if (bootfsb || !temp)
+	if (bootfsb || !temp) {
+		pci_dev_put(nforce2_sub5);
 		return fsb;
+	}
 
 	/* Use PLL register FSB value */
 	pci_read_config_dword(nforce2_dev, NFORCE2_PLLREG, &temp);
 	fsb = nforce2_calc_fsb(temp);
 
+	pci_dev_put(nforce2_sub5);
 	return fsb;
 }
 
Signature · 1 line
2.35.1