From 8f456837b1fba053042852c2b58706cec1ae226e Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Tue, 9 Dec 2014 07:05:07 +0000 Subject: More malloc() -> mallocarray() in the kernel. ok deraadt@ tedu@ --- sys/dev/usb/ehci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/usb/ehci.c') 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); -- cgit v1.2.3