From owner-svn-src-head@freebsd.org Fri Jan 5 23:50:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B025EA7F06; Fri, 5 Jan 2018 23:50:51 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51C87667F0; Fri, 5 Jan 2018 23:50:51 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w05Nookc053748; Fri, 5 Jan 2018 23:50:50 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w05NooUN053747; Fri, 5 Jan 2018 23:50:50 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201801052350.w05NooUN053747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 5 Jan 2018 23:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327606 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 327606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jan 2018 23:50:51 -0000 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);