diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2010-04-21 20:00:13 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2010-04-21 20:00:13 +0000 |
| commit | b6a02e249ff9d5b8cb78f0e389baccfaa8779c9d (patch) | |
| tree | 5e1dc9c7fcb9264f19a555e2707e7fb37d1b9e21 /sys/net | |
| parent | 984c5c6804797f4430e55a0b4de28b6eaedd4f66 (diff) | |
Notes
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/if_clone.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 81ac7ffbdba5..c02737bd4637 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -196,10 +196,11 @@ if_clone_createif(struct if_clone *ifc, char *name, size_t len, caddr_t params) int if_clone_destroy(const char *name) { + int err; struct if_clone *ifc; struct ifnet *ifp; - ifp = ifunit(name); + ifp = ifunit_ref(name); if (ifp == NULL) return (ENXIO); @@ -221,10 +222,14 @@ if_clone_destroy(const char *name) } #endif IF_CLONERS_UNLOCK(); - if (ifc == NULL) + if (ifc == NULL) { + if_rele(ifp); return (EINVAL); + } - return (if_clone_destroyif(ifc, ifp)); + err = if_clone_destroyif(ifc, ifp); + if_rele(ifp); + return err; } /* |
