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;
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34353 )
Change subject: mb/amd/serengeti_cheetah_fam10: Add null pointer check ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34353/1/src/mainboard/amd/serengeti... File src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c:
https://review.coreboot.org/c/coreboot/+/34353/1/src/mainboard/amd/serengeti... PS1, Line 41: using defaults die(...) is noreturn?
Hello Kyösti Mälkki, David Hendricks, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34353
to look at the new patch set (#2).
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, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/34353/2
Jacob Garber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34353 )
Change subject: mb/amd/serengeti_cheetah_fam10: Add null pointer check ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34353/1/src/mainboard/amd/serengeti... File src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c:
https://review.coreboot.org/c/coreboot/+/34353/1/src/mainboard/amd/serengeti... PS1, Line 41: using defaults
die(... […]
Oops, I had copied this from other error messages in this file and misread it
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34353 )
Change subject: mb/amd/serengeti_cheetah_fam10: Add null pointer check ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( 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 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 --- M src/mainboard/amd/serengeti_cheetah_fam10/get_bus_conf.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
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..82670bd 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 @@
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;