diff options
author | John Baldwin <jhb@FreeBSD.org> | 2014-09-26 18:37:49 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2014-09-26 18:37:49 +0000 |
commit | c1d67516d9a02bd60638bd004579a10788c8197d (patch) | |
tree | d9b2d7f77c07c64f99e10180d55a58d6a1f82681 | |
parent | d7771b5006f3a47880922895a3cb76d968537a8d (diff) | |
download | src-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.c | 5 |
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) { |