summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@silverbackltd.com>2017-12-18 09:52:42 -0700
committerMarc Jones <marc@marcjonesconsulting.com>2017-12-19 16:54:59 +0000
commit6c2ab060a221a12c93239d2e9b329b03c0d317b7 (patch)
treeadd3b98613f8309198b17eceea77cc07bfef2218
parentce90c0df4175f3fc9e2d06bd9359485df8834fc3 (diff)
soc/amd/common/block/pci: Fix validation of pointer
Procedure write_pci_int_table() does not validates intr_data_ptr. It must be validated together with picr_data_ptr and idx_name. BUG=b:69868534 TEST=Build fake kahlee with intr_data_ptr not initialized, boot and see error message. Than build correct kahlee and verify that error message is gone. Change-Id: I5ee9a362600dbd6325254d7431172501181b52b0 Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/22934 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
-rw-r--r--src/soc/amd/common/block/pci/amd_pci_util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/soc/amd/common/block/pci/amd_pci_util.c b/src/soc/amd/common/block/pci/amd_pci_util.c
index c5659cbc79..74bb533637 100644
--- a/src/soc/amd/common/block/pci/amd_pci_util.c
+++ b/src/soc/amd/common/block/pci/amd_pci_util.c
@@ -59,11 +59,12 @@ void write_pci_int_table(void)
const struct irq_idx_name *idx_name;
idx_name = sb_get_apic_reg_association(&limit);
- if (picr_data_ptr == NULL || idx_name == NULL) {
+ if (picr_data_ptr == NULL || intr_data_ptr == NULL ||
+ idx_name == NULL) {
printk(BIOS_ERR, "Warning: Can't write PCI_INTR 0xC00/0xC01"
" registers because\n"
- "'mainboard_picr_data' or"
- " irq_association' tables are NULL\n");
+ "'mainboard_picr_data' or 'mainboard_intr_data'"
+ " or 'irq_association'\ntables are NULL\n");
return;
}