Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34353 )
Change subject: mb/amd/serengeti_cheetah_fam10: Add null pointer check ......................................................................
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 --- M src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/34353/1
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 e1f2409..9e73ddf 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,10 @@
dev = dev_find_slot(busn, PCI_DEVFN(devn,0));
+ if (dev == NULL) + die("ERROR - could not find PCI %02x:%02x.0, using defaults\n", + busn, PCI_DEVFN(devn, 0)); + switch (dev->device) { case 0x7458: /* 8132 */ id = 1;