summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2004-04-07 17:02:55 +0000
committerwpaul <wpaul@FreeBSD.org>2004-04-07 17:02:55 +0000
commit52d50449a1c5b609df69f51593635dc137d4f1c7 (patch)
tree519d6fe1ea59b73bef2cabd69cd0d327bfbb4722 /sys
parent66ed31db8ac3bfcd1bfd4f1d9db2a60d5e9fa080 (diff)
downloadFreeBSD-src-52d50449a1c5b609df69f51593635dc137d4f1c7.zip
FreeBSD-src-52d50449a1c5b609df69f51593635dc137d4f1c7.tar.gz
In ndis_convert_res(), initialize the head of our temporary list
before calling BUS_GET_RESOURCE_LIST(). Previously, the list head would only be initialized if BUS_GET_RESOURCE_LIST() succeeded; it needs to be initialized unconditionally so that the list cleanup code won't trip over potential stack garbage.
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/ndis/kern_ndis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c
index 34b7b96..cd928dc 100644
--- a/sys/compat/ndis/kern_ndis.c
+++ b/sys/compat/ndis/kern_ndis.c
@@ -777,6 +777,8 @@ ndis_convert_res(arg)
block = &sc->ndis_block;
dev = sc->ndis_dev;
+ SLIST_INIT(&brl_rev);
+
rl = malloc(sizeof(ndis_resource_list) +
(sizeof(cm_partial_resource_desc) * (sc->ndis_rescnt - 1)),
M_DEVBUF, M_NOWAIT|M_ZERO);
@@ -805,7 +807,6 @@ ndis_convert_res(arg)
* in order to fix this, we have to create our own
* temporary list with the entries in reverse order.
*/
- SLIST_INIT(&brl_rev);
SLIST_FOREACH(brle, brl, link) {
n = malloc(sizeof(struct resource_list_entry),
M_TEMP, M_NOWAIT);
OpenPOWER on IntegriCloud