Date: Wed, 13 Sep 2017 16:23:59 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323549 - head/sys/dev/intpm Message-ID: <201709131623.v8DGNxE0006762@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709131623.v8DGNxE0006762>