svn commit: r272182 - head/sys/kern

John Baldwin jhb at FreeBSD.org
Fri Sep 26 18:37:50 UTC 2014


Author: jhb
Date: Fri Sep 26 18:37:49 2014
New Revision: 272182
URL: http://svnweb.freebsd.org/changeset/base/272182

Log:
  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

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Fri Sep 26 15:16:53 2014	(r272181)
+++ head/sys/kern/subr_bus.c	Fri Sep 26 18:37:49 2014	(r272182)
@@ -3302,7 +3302,10 @@ resource_list_alloc(struct resource_list
 			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) {


More information about the svn-src-all mailing list