summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/net/if_clone.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-20 15:53:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:39 +0200
commit18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d (patch)
treea3020ac5b1f366f2f0920941b589808e435dbcee /freebsd/sys/net/if_clone.c
parentUpdate to FreeBSD head 2017-12-01 (diff)
downloadrtems-libbsd-18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d.tar.bz2
Update to FreeBSD head 2018-02-01
Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4. Update #3472.
Diffstat (limited to 'freebsd/sys/net/if_clone.c')
-rw-r--r--freebsd/sys/net/if_clone.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/freebsd/sys/net/if_clone.c b/freebsd/sys/net/if_clone.c
index 99faa05f..295bddf4 100644
--- a/freebsd/sys/net/if_clone.c
+++ b/freebsd/sys/net/if_clone.c
@@ -357,7 +357,7 @@ if_clone_alloc(const char *name, int maxunit)
return (ifc);
}
-
+
static int
if_clone_attach(struct if_clone *ifc)
{
@@ -389,10 +389,8 @@ if_clone_advanced(const char *name, u_int maxunit, ifc_match_t match,
ifc->ifc_create = create;
ifc->ifc_destroy = destroy;
- if (if_clone_attach(ifc) != 0) {
- if_clone_free(ifc);
+ if (if_clone_attach(ifc) != 0)
return (NULL);
- }
EVENTHANDLER_INVOKE(if_clone_event, ifc);
@@ -412,10 +410,8 @@ if_clone_simple(const char *name, ifcs_create_t create, ifcs_destroy_t destroy,
ifc->ifcs_destroy = destroy;
ifc->ifcs_minifs = minifs;
- if (if_clone_attach(ifc) != 0) {
- if_clone_free(ifc);
+ if (if_clone_attach(ifc) != 0)
return (NULL);
- }
for (unit = 0; unit < minifs; unit++) {
char name[IFNAMSIZ];
@@ -452,7 +448,7 @@ if_clone_detach(struct if_clone *ifc)
/* destroy all interfaces for this cloner */
while (!LIST_EMPTY(&ifc->ifc_iflist))
if_clone_destroyif(ifc, LIST_FIRST(&ifc->ifc_iflist));
-
+
IF_CLONE_REMREF(ifc);
}
@@ -514,7 +510,7 @@ if_clone_list(struct if_clonereq *ifcr)
done:
IF_CLONERS_UNLOCK();
- if (err == 0)
+ if (err == 0 && dst != NULL)
err = copyout(outbuf, dst, buf_count*IFNAMSIZ);
if (outbuf != NULL)
free(outbuf, M_CLONE);