summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-09-07 11:00:48 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-09-07 11:00:48 +0000
commit574ddb2ec7d2327c152bc66a7ff1d22823e3540e (patch)
treedc5038ad02f813476e466d003ad01ac04e60a477
parenta4362a04894916e3a9a11ecaa650c031cd20fee4 (diff)
use M_ZERO
-rw-r--r--sys/net/if_trunk.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c
index a88fb851962..cce73a9341a 100644
--- a/sys/net/if_trunk.c
+++ b/sys/net/if_trunk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_trunk.c,v 1.34 2007/09/06 16:22:55 reyk Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.35 2007/09/07 11:00:47 reyk Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -145,11 +145,9 @@ trunk_clone_create(struct if_clone *ifc, int unit)
int i, error = 0;
if ((tr = malloc(sizeof(struct trunk_softc),
- M_DEVBUF, M_NOWAIT)) == NULL)
+ M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
return (ENOMEM);
- bzero(tr, sizeof(struct trunk_softc));
-
tr->tr_unit = unit;
tr->tr_proto = TRUNK_PROTO_NONE;
for (i = 0; trunk_protos[i].ti_proto != TRUNK_PROTO_NONE; i++) {
@@ -321,11 +319,9 @@ trunk_port_create(struct trunk_softc *tr, struct ifnet *ifp)
return (error);
if ((tp = malloc(sizeof(struct trunk_port),
- M_DEVBUF, M_NOWAIT)) == NULL)
+ M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
return (ENOMEM);
- bzero(tp, sizeof(struct trunk_port));
-
/* Check if port is a stacked trunk */
SLIST_FOREACH(tr_ptr, &trunk_list, tr_entries) {
if (ifp == &tr_ptr->tr_ac.ac_if) {
@@ -1323,9 +1319,8 @@ trunk_lb_attach(struct trunk_softc *tr)
struct trunk_lb *lb;
if ((lb = (struct trunk_lb *)malloc(sizeof(struct trunk_lb),
- M_DEVBUF, M_NOWAIT)) == NULL)
+ M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
return (ENOMEM);
- bzero(lb, sizeof(struct trunk_lb));
tr->tr_detach = trunk_lb_detach;
tr->tr_start = trunk_lb_start;