summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-09-26 18:37:49 +0000
committerjhb <jhb@FreeBSD.org>2014-09-26 18:37:49 +0000
commitb1e77b05a1781cf846ffc7f1a773def90ed4bafa (patch)
treed9b2d7f77c07c64f99e10180d55a58d6a1f82681 /sys/kern
parent046c76ef582defe13797d20b53c8e0af8113916d (diff)
downloadFreeBSD-src-b1e77b05a1781cf846ffc7f1a773def90ed4bafa.zip
FreeBSD-src-b1e77b05a1781cf846ffc7f1a773def90ed4bafa.tar.gz
Don't panic if a resource is allocated twice. Instead, print a warning and
fail the allocation request. Allocations of "reserved" resources such as PCI BARs already fail the request instead of panic'ing in this case. MFC after: 1 week
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_bus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 2aa2123..974c540 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -3302,7 +3302,10 @@ resource_list_alloc(struct resource_list *rl, device_t bus, device_t child,
rle->flags |= RLE_ALLOCATED;
return (rle->res);
}
- panic("resource_list_alloc: resource entry is busy");
+ device_printf(bus,
+ "resource entry %#x type %d for child %s is busy\n", *rid,
+ type, device_get_nameunit(child));
+ return (NULL);
}
if (isdefault) {
OpenPOWER on IntegriCloud