summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-12-30 22:37:28 +0000
committerjhb <jhb@FreeBSD.org>2009-12-30 22:37:28 +0000
commit9d473f39f1650064c6054d0737e0162563b075b5 (patch)
treec7d4bf1677b6ed1785477170c128e32ec3e57647 /sys/kern/subr_bus.c
parent168bb475b7c154727912b8f3f3bc07590fe24a76 (diff)
downloadFreeBSD-src-9d473f39f1650064c6054d0737e0162563b075b5.zip
FreeBSD-src-9d473f39f1650064c6054d0737e0162563b075b5.tar.gz
Actually set RLE_ALLOCATED when allocating a reserved resource so that
resource_list_release() will later release the resource instead of failing.
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 1689505..f76211b 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");
}
OpenPOWER on IntegriCloud