Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2009 22:37:28 +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: r201287 - head/sys/kern
Message-ID:  <200912302237.nBUMbSvc074747@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Dec 30 22:37:28 2009
New Revision: 201287
URL: http://svn.freebsd.org/changeset/base/201287

Log:
  Actually set RLE_ALLOCATED when allocating a reserved resource so that
  resource_list_release() will later release the resource instead of failing.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Wed Dec 30 22:34:26 2009	(r201286)
+++ head/sys/kern/subr_bus.c	Wed Dec 30 22:37:28 2009	(r201287)
@@ -3063,12 +3063,12 @@ resource_list_alloc(struct resource_list
 		if (rle->flags & RLE_RESERVED) {
 			if (rle->flags & RLE_ALLOCATED)
 				return (NULL);
-			else if ((flags & RF_ACTIVE) &&
+			if ((flags & RF_ACTIVE) &&
 			    bus_activate_resource(child, type, *rid,
 			    rle->res) != 0)
 				return (NULL);
-			else
-				return (rle->res);
+			rle->flags |= RLE_ALLOCATED;
+			return (rle->res);
 		}
 		panic("resource_list_alloc: resource entry is busy");
 	}



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