aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorSean Bruno <sbruno@FreeBSD.org>2018-01-05 23:50:50 +0000
committerSean Bruno <sbruno@FreeBSD.org>2018-01-05 23:50:50 +0000
commitcb1103025d020593fa0df06617f7bb722101976e (patch)
treeb17ab621e029e614009718ce012e7ebeadc03f45 /stand
parent32ac401671be7ee8af824460a11661e32df0e194 (diff)
downloadsrc-cb1103025d020593fa0df06617f7bb722101976e.tar.gz
src-cb1103025d020593fa0df06617f7bb722101976e.zip
Handle misconfigured/nonexistent pcidev for comconsole instead of BTX panic.
PR: 203319 Reviewed by: imp jhb MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D13776
Notes
Notes: svn path=/head/; revision=327606
Diffstat (limited to 'stand')
-rw-r--r--stand/i386/libi386/comconsole.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/stand/i386/libi386/comconsole.c b/stand/i386/libi386/comconsole.c
index bd2a2e864fa2..f98a1f74d9d5 100644
--- a/stand/i386/libi386/comconsole.c
+++ b/stand/i386/libi386/comconsole.c
@@ -267,6 +267,16 @@ comc_pcidev_handle(uint32_t locator)
printf("Cannot read bar at 0x%x\n", locator);
return (CMD_ERROR);
}
+
+ /*
+ * biospci_read_config() sets port == 0xffffffff if the pcidev
+ * isn't found on the bus. Check for 0xffffffff and return to not
+ * panic in BTX.
+ */
+ if (port == 0xffffffff) {
+ printf("Cannot find specified pcidev\n");
+ return (CMD_ERROR);
+ }
if (!PCI_BAR_IO(port)) {
printf("Memory bar at 0x%x\n", locator);
return (CMD_ERROR);