cpufreq: nforce2: fix PCI device reference leaks in nforce2_fsb_read
Subsystems (2)
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")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/cpufreq/cpufreq-nforce2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/cpufreq/cpufreq-nforce2.c +4 -1
@@ -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
Quoted 2 lines
Add missing
pci_dev_put()calls to release device references obtained viapci_get_subsys().
* Would you like to complete the object clean-up by using a goto chain?
* How do you think about to increase the application of scope-based resource management?
https://elixir.bootlin.com/linux/v6.17-rc4/source/include/linux/pci.h#L1208
Regards,
Markus