When removing the last reference to a cloner, do not try to unlock twice -

esp. not since the backing memory was just freed.

Reviewed by:	rwatson
This commit is contained in:
mlaier 2004-07-20 21:44:28 +00:00
parent 4557c47e2f
commit 6cc5ed789d

View File

@ -94,9 +94,10 @@ LIST_HEAD(, if_clone) if_cloners = LIST_HEAD_INITIALIZER(if_cloners);
if (--(ifc)->ifc_refcnt == 0) { \
IF_CLONE_UNLOCK(ifc); \
if_clone_free(ifc); \
} else { \
/* silently free the lock */ \
IF_CLONE_UNLOCK(ifc); \
} \
/* silently free the lock */ \
IF_CLONE_UNLOCK(ifc); \
} while (0)
MALLOC_DEFINE(M_CLONE, "clone", "interface cloning framework");