-/* $OpenBSD: aac.c,v 1.68 2017/04/08 02:57:24 deraadt Exp $ */
+/* $OpenBSD: aac.c,v 1.69 2017/04/09 18:07:19 dhill Exp $ */
/*-
* Copyright (c) 2000 Michael Smith
/* Allocate some FIBs and associated command structs */
TAILQ_INIT(&sc->aac_fibmap_tqh);
- sc->aac_commands = malloc(AAC_MAX_FIBS * sizeof(struct aac_command),
+ sc->aac_commands = mallocarray(AAC_MAX_FIBS, sizeof(struct aac_command),
M_DEVBUF, M_WAITOK | M_ZERO);
while (sc->total_fibs < AAC_MAX_FIBS) {
if (aac_alloc_commands(sc) != 0)
-/* $OpenBSD: adw.c,v 1.52 2015/03/14 03:38:47 jsg Exp $ */
+/* $OpenBSD: adw.c,v 1.53 2017/04/09 18:07:19 dhill Exp $ */
/* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */
/*
* Allocate the control structure.
*/
sc->sc_control->carriers =
- malloc(sizeof(ADW_CARRIER) * ADW_MAX_CARRIER, M_DEVBUF,
+ mallocarray(ADW_MAX_CARRIER, sizeof(ADW_CARRIER), M_DEVBUF,
M_NOWAIT);
if (sc->sc_control->carriers == NULL)
return (ENOMEM);
-/* $OpenBSD: ath.c,v 1.112 2017/01/22 10:17:37 dlg Exp $ */
+/* $OpenBSD: ath.c,v 1.113 2017/04/09 18:07:19 dhill Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
int i, ix, nchan;
sc->sc_nchan = 0;
- chans = malloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL),
+ chans = mallocarray(IEEE80211_CHAN_MAX, sizeof(HAL_CHANNEL),
M_TEMP, M_NOWAIT);
if (chans == NULL) {
printf("%s: unable to allocate channel table\n", ifp->if_xname);