Skip to content

Commit fc81bab

Browse files
Malcolm PriestleyKalle Valo
authored andcommitted
rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter
_rtl_pci_find_adapter fail path will jump to label fail3 for unsupported adapter types. However, on course for fail3 there will be call rtl_deinit_core before rtl_init_core. For the inclusion of checking pci_iounmap this fail can be moved to fail2. Fixes [ 4.492963] BUG: unable to handle kernel NULL pointer dereference at (null) [ 4.493067] IP: rtl_deinit_core+0x31/0x90 [rtlwifi] Signed-off-by: Malcolm Priestley <[email protected]> Cc: <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 06384f7 commit fc81bab

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/wireless/realtek/rtlwifi

1 file changed

+2
-2
lines changed

drivers/net/wireless/realtek/rtlwifi/pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
22572257
/* find adapter */
22582258
if (!_rtl_pci_find_adapter(pdev, hw)) {
22592259
err = -ENODEV;
2260-
goto fail3;
2260+
goto fail2;
22612261
}
22622262

22632263
/* Init IO handler */
@@ -2318,10 +2318,10 @@ int rtl_pci_probe(struct pci_dev *pdev,
23182318
pci_set_drvdata(pdev, NULL);
23192319
rtl_deinit_core(hw);
23202320

2321+
fail2:
23212322
if (rtlpriv->io.pci_mem_start != 0)
23222323
pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start);
23232324

2324-
fail2:
23252325
pci_release_regions(pdev);
23262326
complete(&rtlpriv->firmware_loading_complete);
23272327

0 commit comments

Comments
 (0)