-/* $OpenBSD: uaudio.c,v 1.124 2017/02/10 08:09:36 ratchov Exp $ */
+/* $OpenBSD: uaudio.c,v 1.125 2017/04/05 22:45:21 deraadt Exp $ */
/* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */
/*
ibufend = ibuf + aclen;
dp = (const usb_descriptor_t *)ibuf;
ndps = 0;
- iot = malloc(256 * sizeof(struct io_terminal),
+ iot = mallocarray(256, sizeof(struct io_terminal),
M_TEMP, M_NOWAIT | M_ZERO);
if (iot == NULL) {
printf("%s: no memory\n", __func__);
-/* $OpenBSD: usb_subr.c,v 1.132 2017/03/26 15:31:15 deraadt Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.133 2017/04/05 22:45:21 deraadt Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
DPRINTF(("usbd_probe_and_attach trying device specific drivers\n"));
dv = config_found(parent, &uaa, usbd_print);
if (dv) {
- dev->subdevs = malloc(2 * sizeof dv, M_USB, M_NOWAIT);
+ dev->subdevs = mallocarray(2, sizeof dv, M_USB, M_NOWAIT);
if (dev->subdevs == NULL) {
err = USBD_NOMEM;
goto fail;
dv = config_found(parent, &uaa, usbd_print);
if (dv != NULL) {
if (dev->ndevs == 0) {
- dev->subdevs = malloc(2 * sizeof dv, M_USB, M_NOWAIT);
+ dev->subdevs = mallocarray(2, sizeof dv, M_USB, M_NOWAIT);
if (dev->subdevs == NULL) {
err = USBD_NOMEM;
goto fail;