diff options
author | mlaier <mlaier@FreeBSD.org> | 2004-07-20 21:44:28 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2004-07-20 21:44:28 +0000 |
commit | 6cc5ed789d5d50e63119de71ef76af27214ceba9 (patch) | |
tree | 1bb62367b7c37ff8a80c10b00ce16fd44ae48d8c | |
parent | 4557c47e2f0db8fa10647f2394e17a3073358390 (diff) | |
download | FreeBSD-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
-rw-r--r-- | sys/net/if_clone.c | 5 |
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"); |