[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251225012821.1610670-1-lihaoxiang@isrc.iscas.ac.cn>
Date: Thu, 25 Dec 2025 09:28:21 +0800
From: Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>
To: bhelgaas@...gle.com,
tglx@...utronix.de,
mingo@...hat.com,
bp@...en8.de,
dave.hansen@...ux.intel.com,
x86@...nel.org,
hpa@...or.com
Cc: linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>
Subject: [PATCH] x86/PCI: add a check for alloc_pci_root_info()
Add a return value check for alloc_pci_root_info() to
prevent null pointer dereference in update_res().
Signed-off-by: Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>
---
arch/x86/pci/broadcom_bus.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/pci/broadcom_bus.c b/arch/x86/pci/broadcom_bus.c
index 2db73613cada..d0cf7d2acc65 100644
--- a/arch/x86/pci/broadcom_bus.c
+++ b/arch/x86/pci/broadcom_bus.c
@@ -27,6 +27,8 @@ static void __init cnb20le_res(u8 bus, u8 slot, u8 func)
fbus = read_pci_config_byte(bus, slot, func, 0x44);
lbus = read_pci_config_byte(bus, slot, func, 0x45);
info = alloc_pci_root_info(fbus, lbus, 0, 0);
+ if (!info)
+ return;
/*
* Add the legacy IDE ports on bus 0
--
2.25.1
Powered by blists - more mailing lists