diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2007-09-10 16:29:29 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2007-09-10 16:29:29 +0000 |
commit | d6f25b8de5aa09994c45f3a4e186b26276bc71c2 (patch) | |
tree | 9545c7be1a6876de3ae3f79d21e158e2813cb386 /sys | |
parent | 4bb6947b738392d059ccec81a601802f2a3f67e1 (diff) |
more M_ZERO usage.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/ucycom.c | 5 | ||||
-rw-r--r-- | sys/dev/usb/uhci.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index 160c1b91148..3386a06a351 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucycom.c,v 1.11 2007/06/14 10:11:15 mbalmer Exp $ */ +/* $OpenBSD: ucycom.c,v 1.12 2007/09/10 16:29:28 fgsch Exp $ */ /* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */ /* @@ -281,7 +281,7 @@ ucycom_open(void *addr, int portno) return (EIO); /* Allocate an output report buffer */ - sc->sc_obuf = malloc(sc->sc_olen, M_USBDEV, M_WAITOK); + sc->sc_obuf = malloc(sc->sc_olen, M_USBDEV, M_WAITOK|M_ZERO); /* Allocate an input report buffer */ sc->sc_ibuf = malloc(sc->sc_ilen, M_USBDEV, M_WAITOK); @@ -294,7 +294,6 @@ ucycom_open(void *addr, int portno) (void)ucycom_param(sc, portno, &t); sc->sc_mcr = UCYCOM_DTR | UCYCOM_RTS; - memset(sc->sc_obuf, 0, sc->sc_olen); sc->sc_obuf[0] = sc->sc_mcr; err = uhidev_write(sc->sc_hdev.sc_parent, sc->sc_obuf, sc->sc_olen); if (err) { diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 01c31b14e3f..499a2e2f3b4 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci.c,v 1.61 2007/07/20 14:31:17 mbalmer Exp $ */ +/* $OpenBSD: uhci.c,v 1.62 2007/09/10 16:29:28 fgsch Exp $ */ /* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -577,10 +577,9 @@ uhci_allocm(struct usbd_bus *bus, usb_dma_t *dma, u_int32_t size) 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); + M_NOWAIT|M_ZERO); if (stds == NULL) panic("uhci_allocm"); - memset(stds, 0, sizeof(uhci_soft_td_t *) * n); for(i=0; i < n; i++) stds[i] = uhci_alloc_std(sc); for(i=0; i < n; i++) |