summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2007-09-07 10:57:23 +0000
committerreyk <reyk@openbsd.org>2007-09-07 10:57:23 +0000
commit4ba500ade80485552d094714e06de3d7c3f440c7 (patch)
tree8cf645b8c38c26e7b66309ddf5250fc9fe484e9e
parentDocument M_ZERO. (diff)
downloadwireguard-openbsd-4ba500ade80485552d094714e06de3d7c3f440c7.tar.xz
wireguard-openbsd-4ba500ade80485552d094714e06de3d7c3f440c7.zip
use M_ZERO
-rw-r--r--sys/dev/ic/ar5xxx.c10
-rw-r--r--sys/net/if_trunk.c13
2 files changed, 8 insertions, 15 deletions
diff --git a/sys/dev/ic/ar5xxx.c b/sys/dev/ic/ar5xxx.c
index 75d31f4d090..57cf04bf7a4 100644
--- a/sys/dev/ic/ar5xxx.c
+++ b/sys/dev/ic/ar5xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.c,v 1.42 2007/06/26 10:53:01 tom Exp $ */
+/* $OpenBSD: ar5xxx.c,v 1.43 2007/09/07 10:57:23 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -174,14 +174,12 @@ ath_hal_attach(u_int16_t device, void *arg, bus_space_tag_t st,
}
if ((hal = malloc(sizeof(struct ath_hal),
- M_DEVBUF, M_NOWAIT)) == NULL) {
+ M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) {
*status = ENOMEM;
AR5K_PRINT("out of memory\n");
return (NULL);
}
- bzero(hal, sizeof(struct ath_hal));
-
hal->ah_sc = sc;
hal->ah_st = st;
hal->ah_sh = sh;
@@ -397,7 +395,7 @@ ath_hal_init_channels(struct ath_hal *hal, HAL_CHANNEL *channels,
HAL_CHANNEL *all_channels;
if ((all_channels = malloc(sizeof(HAL_CHANNEL) * max_channels,
- M_TEMP, M_NOWAIT)) == NULL)
+ M_TEMP, M_NOWAIT|M_ZERO)) == NULL)
return (AH_FALSE);
i = c = 0;
@@ -1498,7 +1496,7 @@ ar5k_rfregs(struct ath_hal *hal, HAL_CHANNEL *channel, u_int mode)
if (hal->ah_rf_banks == NULL) {
/* XXX do extra checks? */
if ((hal->ah_rf_banks = malloc(hal->ah_rf_banks_size,
- M_DEVBUF, M_NOWAIT)) == NULL) {
+ M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) {
AR5K_PRINT("out of memory\n");
return (AH_FALSE);
}
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;