wifi: iwlegacy: 3945: free EEPROM data on remove
Subsystems (2)
PATCH 1/1 wifi: iwlegacy: 3945: free EEPROM data on remove
il3945_pci_probe() calls il_eeprom_init(), which allocates memory for the EEPROM data. The probe failure paths release this allocation with il_eeprom_free(), but the remove path does not free it after a successful probe.
As a result, the EEPROM data is leaked when the PCI device is removed.
Free the EEPROM data in il3945_pci_remove() before releasing the mac80211 hardware structure.
This issue was found by manual code inspection.
--- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlegacy/3945-mac.c +1 -0
@@ -3807,6 +3807,7 @@ il3945_pci_remove(struct pci_dev *pdev)il_free_channel_map (il);il_free_geos (il); +il_eeprom_free (il);kfree (il->scan_cmd);dev_kfree_skb (il->beacon_skb);ieee80211_free_hw (il->hw);
Signature · 1 line
2.43.0
Quoted 7 lines · Guangshuo Li
il3945_pci_probe()callsil_eeprom_init(), which allocates memory for the EEPROM data. The probe failure paths release this allocation withil_eeprom_free(), but the remove path does not free it after a successful probe.As a result, the EEPROM data is leaked when the PCI device is removed.
Quoted 8 lines
Free the EEPROM data in
il3945_pci_remove()before releasing the mac80211 hardware structure.This issue was found by manual code inspection.
Fixes 073d3f5f1b3b ("iwlwifi: changing EEPROM layout handling")Signed-off-by Guangshuo Li <[email protected]>
Quoted 19 lines
--- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 1 + 1 file changed, 1 insertion(+)drivers/net/wireless/intel/iwlegacy/3945-mac.c +1
-0@@ -3807,6 +3807,7 @@ il3945_pci_remove(struct pci_dev *pdev)il_free_channel_map (il);il_free_geos (il); +il_eeprom_free (il);kfree (il->scan_cmd);dev_kfree_skb (il->beacon_skb);ieee80211_free_hw (il->hw);Signature · 1 line
2.43.0