Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Sep 2014 18:37:50 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272182 - head/sys/kern
Message-ID:  <201409261837.s8QIboUl013638@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409261837.s8QIboUl013638>