summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2006-02-24 17:25:16 +0000
committeryar <yar@FreeBSD.org>2006-02-24 17:25:16 +0000
commite93973003073f1a6c0f27920ffd1b2e8de1a4742 (patch)
treebbfb0868b95792c0bb997bab2495fcba70037864 /sys
parentfbf57fcf0eed36bfa5ed056bcefced078e9dddf1 (diff)
downloadFreeBSD-src-e93973003073f1a6c0f27920ffd1b2e8de1a4742.zip
FreeBSD-src-e93973003073f1a6c0f27920ffd1b2e8de1a4742.tar.gz
Don't to forget to unlock the rwlock on trunk before destroying it.
This should fix panic on "kldunload if_vlan" while vlanX are still there. Reviewed by: glebius
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_vlan.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index dbed1bd..00ed046 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -379,9 +379,10 @@ trunk_destroy(struct ifvlantrunk *trunk)
#ifndef VLAN_ARRAY
vlan_freehash(trunk);
#endif
- TRUNK_LOCK_DESTROY(trunk);
- LIST_REMOVE(trunk, trunk_entry);
trunk->parent->if_vlantrunk = NULL;
+ LIST_REMOVE(trunk, trunk_entry);
+ TRUNK_UNLOCK(trunk);
+ TRUNK_LOCK_DESTROY(trunk);
free(trunk, M_VLAN);
}
OpenPOWER on IntegriCloud