summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-07-15 13:18:00 -0600
committerPatrick Georgi <pgeorgi@google.com>2019-08-20 15:19:23 +0000
commit137f41f2d405e050f539cf06b1e29b8ee77915fa (patch)
treeef9fb1a86e2ae10396acf651d2410c155d9b3876 /src/mainboard
parent8216b46d7b9b88be4e31660362c4b9077670fd33 (diff)
mb/amd/serengeti_cheetah_fam10: Add null pointer check
Print an error message and die if the PCI device cannot be found. Change-Id: I10c58502658ebf12d1a8fe826ee7d47a618fd1c8 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 1403000 Reviewed-on: https://review.coreboot.org/c/coreboot/+/34353 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c b/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c
index e1f2409504..82670bd586 100644
--- a/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c
+++ b/src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c
@@ -37,6 +37,9 @@ static u32 get_hcid(u32 i)
dev = dev_find_slot(busn, PCI_DEVFN(devn,0));
+ if (dev == NULL)
+ die("ERROR - could not find PCI %02x:%02x.0\n", busn, PCI_DEVFN(devn, 0));
+
switch (dev->device) {
case 0x7458: /* 8132 */
id = 1;