Skip to content

Commit cc9b630

Browse files
pchelkin91gregkh
authored andcommitted
wifi: rtw88: check for PCI upstream bridge existence
commit eb101d2 upstream. pci_upstream_bridge() returns NULL if the device is on a root bus. If 8821CE is installed in the system with such a PCI topology, the probing routine will crash. This has probably been unnoticed as 8821CE is mostly supplied in laptops where there is a PCI-to-PCI bridge located upstream from the device. However the card might be installed on a system with different configuration. Check if the bridge does exist for the specific workaround to be applied. Found by Linux Verification Center (linuxtesting.org) with Svace static analysis tool. Fixes: 24f5e38 ("rtw88: Disable PCIe ASPM while doing NAPI poll on 8821CE") Cc: stable@vger.kernel.org Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru> Acked-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20260220094730.49791-1-pchelkin@ispras.ru Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2d1f18e commit cc9b630

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/net/wireless/realtek/rtw88

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1749,7 +1749,8 @@ int rtw_pci_probe(struct pci_dev *pdev,
17491749
}
17501750

17511751
/* Disable PCIe ASPM L1 while doing NAPI poll for 8821CE */
1752-
if (rtwdev->chip->id == RTW_CHIP_TYPE_8821C && bridge->vendor == PCI_VENDOR_ID_INTEL)
1752+
if (rtwdev->chip->id == RTW_CHIP_TYPE_8821C &&
1753+
bridge && bridge->vendor == PCI_VENDOR_ID_INTEL)
17531754
rtwpci->rx_no_aspm = true;
17541755

17551756
rtw_pci_phy_cfg(rtwdev);

0 commit comments

Comments
 (0)