summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-04-07 17:53:58 +0000
committerjoe <joe@FreeBSD.org>2002-04-07 17:53:58 +0000
commit983435953ccd34eb023b73aac37138c70b6fa38b (patch)
tree34cb19196d12b28f682c38cea318980ba4babc82 /sys/dev/usb
parent6a6580e54968b10a7212ee5aa48a1183f85ca98b (diff)
downloadFreeBSD-src-983435953ccd34eb023b73aac37138c70b6fa38b.zip
FreeBSD-src-983435953ccd34eb023b73aac37138c70b6fa38b.tar.gz
MFNetBSD: hid.c (1.22), uhci.c (1.150), usb_subr.c (1.97)
date: 2002/01/14 13:23:37; author: tsutsui; Call malloc(9) with M_ZERO flag instead of memset() after malloc().
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/hid.c3
-rw-r--r--sys/dev/usb/uhci.c6
-rw-r--r--sys/dev/usb/usb_subr.c3
3 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c
index aa4014e..0323132 100644
--- a/sys/dev/usb/hid.c
+++ b/sys/dev/usb/hid.c
@@ -96,8 +96,7 @@ hid_start_parse(void *d, int len, int kindset)
{
struct hid_data *s;
- s = malloc(sizeof *s, M_TEMP, M_WAITOK);
- memset(s, 0, sizeof *s);
+ s = malloc(sizeof *s, M_TEMP, M_WAITOK|M_ZERO);
s->start = s->p = d;
s->end = (char *)d + len;
s->kindset = kindset;
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index f965098..2594755 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci.c,v 1.149 2001/11/21 15:48:37 augustss Exp $ */
+/* $NetBSD: uhci.c,v 1.150 2002/01/14 13:23:37 tsutsui Exp $ */
/* $FreeBSD$ */
/*
@@ -588,8 +588,8 @@ uhci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size)
u_int32_t i;
uhci_soft_td_t **stds;
DPRINTF(("uhci_allocm: get %d TDs\n", n));
- stds = malloc(sizeof(uhci_soft_td_t *) * n, M_TEMP, M_NOWAIT);
- memset(stds, 0, sizeof(uhci_soft_td_t *) * n);
+ stds = malloc(sizeof(uhci_soft_td_t *) * n, M_TEMP,
+ M_NOWAIT|M_ZERO);
for(i=0; i < n; i++)
stds[i] = uhci_alloc_std(sc);
for(i=0; i < n; i++)
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index a151027..160f833 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -947,10 +947,9 @@ usbd_new_device(device_ptr_t parent, usbd_bus_handle bus, int depth,
return (USBD_NO_ADDR);
}
- dev = malloc(sizeof *dev, M_USB, M_NOWAIT);
+ dev = malloc(sizeof *dev, M_USB, M_NOWAIT|M_ZERO);
if (dev == NULL)
return (USBD_NOMEM);
- memset(dev, 0, sizeof(*dev));
dev->bus = bus;
OpenPOWER on IntegriCloud