From owner-svn-src-all@freebsd.org Wed Sep 13 16:24:00 2017 Return-Path: Delivered-To: svn-src-all@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 8C942E0412E; Wed, 13 Sep 2017 16:24:00 +0000 (UTC) (envelope-from cem@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 5A0E86C7C3; Wed, 13 Sep 2017 16:24:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8DGNx6A006763; Wed, 13 Sep 2017 16:23:59 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8DGNxE0006762; Wed, 13 Sep 2017 16:23:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201709131623.v8DGNxE0006762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 13 Sep 2017 16:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323549 - head/sys/dev/intpm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/intpm X-SVN-Commit-Revision: 323549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2017 16:24:00 -0000 Author: cem Date: Wed Sep 13 16:23:59 2017 New Revision: 323549 URL: https://svnweb.freebsd.org/changeset/base/323549 Log: intpm(4): Do not attach if io_res can not be allocated Attempts to use the driver without an io_res result in immediate panic. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/intpm/intpm.c Modified: head/sys/dev/intpm/intpm.c ============================================================================== --- head/sys/dev/intpm/intpm.c Wed Sep 13 16:21:11 2017 (r323548) +++ head/sys/dev/intpm/intpm.c Wed Sep 13 16:23:59 2017 (r323549) @@ -191,6 +191,10 @@ sb8xx_attach(device_t dev) } sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->io_rid, RF_ACTIVE); + if (sc->io_res == NULL) { + device_printf(dev, "Could not allocate I/O space\n"); + return (ENXIO); + } sc->poll = 1; return (0); }