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
This commit is contained in:
Sean Bruno 2018-01-05 23:50:50 +00:00
parent 32ac401671
commit cb1103025d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327606

View File

@ -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);