aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_bus.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2009-12-30 22:37:28 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2009-12-30 22:37:28 +0000
commit6a41dc104316a8bc35ac5b6de3a4f7cfbe74a63e (patch)
treec7d4bf1677b6ed1785477170c128e32ec3e57647 /sys/kern/subr_bus.c
parent3a6b4b04ab8a701413dd31c215fb0a9e9aeffd0a (diff)
downloadsrc-6a41dc104316a8bc35ac5b6de3a4f7cfbe74a63e.tar.gz
src-6a41dc104316a8bc35ac5b6de3a4f7cfbe74a63e.zip
Actually set RLE_ALLOCATED when allocating a reserved resource so that
resource_list_release() will later release the resource instead of failing.
Notes
Notes: svn path=/head/; revision=201287
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r--sys/kern/subr_bus.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 16895051ca9b..f76211baab65 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -3063,12 +3063,12 @@ resource_list_alloc(struct resource_list *rl, device_t bus, device_t child,
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");
}