summaryrefslogtreecommitdiff
path: root/sys/netbt
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-01 16:39:31 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-01 16:39:31 +0000
commit5a93b7b14326715c9e05692f21723cbd2531f8ee (patch)
tree2679daadf708c6a77ae4f6ff29b583db5965079f /sys/netbt
parent1d3a2c7615ad6b5663e200fe3e8a475ef3203245 (diff)
Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.
Diffstat (limited to 'sys/netbt')
-rw-r--r--sys/netbt/hci_event.c7
-rw-r--r--sys/netbt/l2cap_upper.c6
-rw-r--r--sys/netbt/rfcomm_upper.c5
-rw-r--r--sys/netbt/sco_upper.c5
4 files changed, 9 insertions, 14 deletions
diff --git a/sys/netbt/hci_event.c b/sys/netbt/hci_event.c
index 91973c9e515..b4be8a5aff4 100644
--- a/sys/netbt/hci_event.c
+++ b/sys/netbt/hci_event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hci_event.c,v 1.5 2007/06/19 08:12:35 uwe Exp $ */
+/* $OpenBSD: hci_event.c,v 1.6 2007/10/01 16:39:30 krw Exp $ */
/* $NetBSD: hci_event.c,v 1.6 2007/04/21 06:15:23 plunky Exp $ */
/*-
@@ -434,13 +434,12 @@ hci_event_inquiry_result(struct hci_unit *unit, struct mbuf *m)
memo = hci_memo_find(unit, &bdaddr);
if (memo == NULL) {
- memo = malloc(sizeof(struct hci_memo),
- M_BLUETOOTH, M_NOWAIT);
+ memo = malloc(sizeof(*memo), M_BLUETOOTH,
+ M_NOWAIT | M_ZERO);
if (memo == NULL) {
DPRINTFN(0, "out of memo memory!\n");
break;
}
- bzero(memo, sizeof *memo);
LIST_INSERT_HEAD(&unit->hci_memos, memo, next);
}
diff --git a/sys/netbt/l2cap_upper.c b/sys/netbt/l2cap_upper.c
index b33d51815f9..d3236a95a99 100644
--- a/sys/netbt/l2cap_upper.c
+++ b/sys/netbt/l2cap_upper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: l2cap_upper.c,v 1.1 2007/06/01 02:46:11 uwe Exp $ */
+/* $OpenBSD: l2cap_upper.c,v 1.2 2007/10/01 16:39:30 krw Exp $ */
/* $NetBSD: l2cap_upper.c,v 1.8 2007/04/29 20:23:36 msaitoh Exp $ */
/*-
@@ -67,11 +67,9 @@ l2cap_attach(struct l2cap_channel **handle,
KASSERT(proto != NULL);
KASSERT(upper != NULL);
- chan = malloc(sizeof(struct l2cap_channel), M_BLUETOOTH,
- M_NOWAIT);
+ chan = malloc(sizeof(*chan), M_BLUETOOTH, M_NOWAIT | M_ZERO);
if (chan == NULL)
return ENOMEM;
- bzero(chan, sizeof *chan);
chan->lc_proto = proto;
chan->lc_upper = upper;
diff --git a/sys/netbt/rfcomm_upper.c b/sys/netbt/rfcomm_upper.c
index 804d21e20a6..da606b2741b 100644
--- a/sys/netbt/rfcomm_upper.c
+++ b/sys/netbt/rfcomm_upper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfcomm_upper.c,v 1.2 2007/06/26 10:30:05 tom Exp $ */
+/* $OpenBSD: rfcomm_upper.c,v 1.3 2007/10/01 16:39:30 krw Exp $ */
/* $NetBSD: rfcomm_upper.c,v 1.6 2007/04/21 06:15:23 plunky Exp $ */
/*-
@@ -69,10 +69,9 @@ rfcomm_attach(struct rfcomm_dlc **handle,
KASSERT(proto != NULL);
KASSERT(upper != NULL);
- dlc = malloc(sizeof(struct rfcomm_dlc), M_BLUETOOTH, M_NOWAIT);
+ dlc = malloc(sizeof(*dlc), M_BLUETOOTH, M_NOWAIT | M_ZERO);
if (dlc == NULL)
return ENOMEM;
- bzero(dlc, sizeof *dlc);
dlc->rd_state = RFCOMM_DLC_CLOSED;
dlc->rd_mtu = rfcomm_mtu_default;
diff --git a/sys/netbt/sco_upper.c b/sys/netbt/sco_upper.c
index f867367c5db..7a27b4a89cf 100644
--- a/sys/netbt/sco_upper.c
+++ b/sys/netbt/sco_upper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sco_upper.c,v 1.1 2007/06/01 02:46:12 uwe Exp $ */
+/* $OpenBSD: sco_upper.c,v 1.2 2007/10/01 16:39:30 krw Exp $ */
/* $NetBSD: sco_upper.c,v 1.6 2007/03/30 20:47:03 plunky Exp $ */
/*-
@@ -66,10 +66,9 @@ sco_attach(struct sco_pcb **handle,
KASSERT(proto != NULL);
KASSERT(upper != NULL);
- pcb = malloc(sizeof(struct sco_pcb), M_BLUETOOTH, M_NOWAIT);
+ pcb = malloc(sizeof(*pcb), M_BLUETOOTH, M_NOWAIT | M_ZERO);
if (pcb == NULL)
return ENOMEM;
- bzero(pcb, sizeof *pcb);
pcb->sp_proto = proto;
pcb->sp_upper = upper;