diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2014-12-09 07:05:07 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2014-12-09 07:05:07 +0000 |
commit | 8f456837b1fba053042852c2b58706cec1ae226e (patch) | |
tree | 14aed88be4d213bba6895e0464371d1393be6c24 /sys/dev/usb/ehci.c | |
parent | ad90d9845d96f21749e3776b0296938c6d60ca9a (diff) |
More malloc() -> mallocarray() in the kernel.
ok deraadt@ tedu@
Diffstat (limited to 'sys/dev/usb/ehci.c')
-rw-r--r-- | sys/dev/usb/ehci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index d46fa003ba0..704f3da76d2 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.170 2014/11/18 02:37:30 tedu Exp $ */ +/* $OpenBSD: ehci.c,v 1.171 2014/12/09 07:05:06 doug Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -362,8 +362,8 @@ ehci_init(struct ehci_softc *sc) EOWRITE4(sc, EHCI_PERIODICLISTBASE, DMAADDR(&sc->sc_fldma, 0)); - sc->sc_softitds = malloc(sc->sc_flsize * sizeof(struct ehci_soft_itd *), - M_USB, M_NOWAIT | M_ZERO); + sc->sc_softitds = mallocarray(sc->sc_flsize, + sizeof(struct ehci_soft_itd *), M_USB, M_NOWAIT | M_ZERO); if (sc->sc_softitds == NULL) return (ENOMEM); LIST_INIT(&sc->sc_freeitds); |