aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2014-09-26 18:37:49 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2014-09-26 18:37:49 +0000
commitc1d67516d9a02bd60638bd004579a10788c8197d (patch)
treed9b2d7f77c07c64f99e10180d55a58d6a1f82681
parentd7771b5006f3a47880922895a3cb76d968537a8d (diff)
downloadsrc-c1d67516d9a02bd60638bd004579a10788c8197d.tar.gz
src-c1d67516d9a02bd60638bd004579a10788c8197d.zip
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
Notes
Notes: svn path=/head/; revision=272182
-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 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) {