From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24EF244E046 for ; Thu, 30 Apr 2026 16:07:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777565264; cv=none; b=PnDTTyO4enN6pYzgQUplVXUikD5bYvm02UW+CtEfSsfawt3hjzPcuDpi+DDAwFZ8nrOGeYJFqynVD8DY3wO7O6elMMQ86FaY5svsgbdK1hn8Gm5pRw5Go8LYwP5rNFDUvHIqA/iftuzplrX508MyImwzGRdUw6PN6w6khwihrL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777565264; c=relaxed/simple; bh=T5Mie+1DVUvNQRGLKcZZ6+2ECG+6M5qMcOTxf9GXbv4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lbSJrmIiiuxNvIAcxKEFHOwiQqI2N1MeID0dJgmnppk3L3N6HLrMtAiubkDX79MGwU725Gg3xlOMhY1kt3zrNVjeu+LQ+Jd975N7l8Vnsr8hlPebEFal6mVwcTkjUUJAHCwDZ3XMseNPut3NO57mtkIJi9Gi4HN/EexUAOrAjAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f+9kKBgn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f+9kKBgn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 520B7C2BCC9; Thu, 30 Apr 2026 16:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777565263; bh=T5Mie+1DVUvNQRGLKcZZ6+2ECG+6M5qMcOTxf9GXbv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f+9kKBgnwEtYZOFIME3/Yo5u4xOFhcEBBjdLcByoQO+WYGbBfX3ioNX+jeJQFea/m iLUGAwZnFvHZHqE8/c79bpUsoxOmgjf5IGC/choDPzyVdgiB4y0uEzlQY1FOENvAvh zZIMlW5dyuHZZdhXErQEaNyP4I57i7sboWRo76UxsngHsbf/XS/abqia7o6rwCmOR8 sftSTpwcJgXwryI46+7CfrSqwRyk2aC8UMXmZhl1TIPAdbIa7zY9Ir/37HPaCgtpgx pGhI6ud2stkRiCd42XSA54NTVk7dPGV4qKFEI4nC0vYDeV5llSFV5pFwtXhl5VIN5P NV14LbW1wKQ7Q== From: Sasha Levin To: stable@vger.kernel.org Cc: Fedor Pchelkin , Ping-Ke Shih , Sasha Levin Subject: [PATCH 5.15.y 2/2] wifi: rtw88: check for PCI upstream bridge existence Date: Thu, 30 Apr 2026 12:07:40 -0400 Message-ID: <20260430160740.1785374-2-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260430160740.1785374-1-sashal@kernel.org> References: <2026043013-untainted-dominion-7f06@gregkh> <20260430160740.1785374-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Fedor Pchelkin [ Upstream commit eb101d2abdcccb514ca4fccd3b278dd8267374f6 ] 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: 24f5e38a13b5 ("rtw88: Disable PCIe ASPM while doing NAPI poll on 8821CE") Cc: stable@vger.kernel.org Signed-off-by: Fedor Pchelkin Acked-by: Ping-Ke Shih Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20260220094730.49791-1-pchelkin@ispras.ru Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw88/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index 0d1b1dfab8a2c..fa302d5e7839d 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -1766,7 +1766,8 @@ int rtw_pci_probe(struct pci_dev *pdev, } /* Disable PCIe ASPM L1 while doing NAPI poll for 8821CE */ - if (rtwdev->chip->id == RTW_CHIP_TYPE_8821C && bridge->vendor == PCI_VENDOR_ID_INTEL) + if (rtwdev->chip->id == RTW_CHIP_TYPE_8821C && + bridge && bridge->vendor == PCI_VENDOR_ID_INTEL) rtwpci->rx_no_aspm = true; rtw_pci_phy_cfg(rtwdev); -- 2.53.0