From c1d67516d9a02bd60638bd004579a10788c8197d Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 26 Sep 2014 18:37:49 +0000 Subject: [PATCH] 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 --- sys/kern/subr_bus.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 2aa21238d514..974c54039962 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) {