Date: Fri, 5 Jan 2018 23:50:50 +0000 (UTC) From: Sean Bruno <sbruno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327606 - head/stand/i386/libi386 Message-ID: <201801052350.w05NooUN053747@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sbruno Date: Fri Jan 5 23:50:50 2018 New Revision: 327606 URL: https://svnweb.freebsd.org/changeset/base/327606 Log: 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 Modified: head/stand/i386/libi386/comconsole.c Modified: head/stand/i386/libi386/comconsole.c ============================================================================== --- head/stand/i386/libi386/comconsole.c Fri Jan 5 23:21:47 2018 (r327605) +++ head/stand/i386/libi386/comconsole.c Fri Jan 5 23:50:50 2018 (r327606) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801052350.w05NooUN053747>