summaryrefslogtreecommitdiffstats
path: root/sys/net/if_clone.c
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-07-20 21:44:28 +0000
committermlaier <mlaier@FreeBSD.org>2004-07-20 21:44:28 +0000
commit6cc5ed789d5d50e63119de71ef76af27214ceba9 (patch)
tree1bb62367b7c37ff8a80c10b00ce16fd44ae48d8c /sys/net/if_clone.c
parent4557c47e2f0db8fa10647f2394e17a3073358390 (diff)
downloadFreeBSD-src-6cc5ed789d5d50e63119de71ef76af27214ceba9.zip
FreeBSD-src-6cc5ed789d5d50e63119de71ef76af27214ceba9.tar.gz
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
Diffstat (limited to 'sys/net/if_clone.c')
-rw-r--r--sys/net/if_clone.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c
index 37184b2..04c54bd 100644
--- a/sys/net/if_clone.c
+++ b/sys/net/if_clone.c
@@ -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");
OpenPOWER on IntegriCloud