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
This commit is contained in:
yar 2006-02-24 17:25:16 +00:00
parent fbf57fcf0e
commit e939730030

View File

@ -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);
}