-/* $OpenBSD: azalia.c,v 1.233 2017/03/19 11:18:26 jsg Exp $ */
+/* $OpenBSD: azalia.c,v 1.234 2017/04/09 18:16:00 dhill Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
DPRINTF(("%s: RIRB allocation succeeded.\n", __func__));
/* setup the unsolicited response queue */
- az->unsolq = malloc(sizeof(rirb_entry_t) * UNSOLQ_SIZE,
+ az->unsolq = mallocarray(UNSOLQ_SIZE, sizeof(rirb_entry_t),
M_DEVBUF, M_NOWAIT | M_ZERO);
if (az->unsolq == NULL) {
DPRINTF(("%s: can't allocate unsolicited response queue.\n",
-/* $OpenBSD: if_dc_pci.c,v 1.74 2015/11/24 17:11:39 mpi Exp $ */
+/* $OpenBSD: if_dc_pci.c,v 1.75 2017/04/09 18:16:00 dhill Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
sc->dc_type = DC_TYPE_PNIC;
sc->dc_flags |= DC_TX_STORENFWD|DC_TX_INTR_ALWAYS;
sc->dc_flags |= DC_PNIC_RX_BUG_WAR;
- sc->dc_pnic_rx_buf = malloc(ETHER_MAX_DIX_LEN * 5, M_DEVBUF,
- M_NOWAIT);
+ sc->dc_pnic_rx_buf = mallocarray(5, ETHER_MAX_DIX_LEN,
+ M_DEVBUF, M_NOWAIT);
if (sc->dc_pnic_rx_buf == NULL)
panic("dc_pci_attach");
if (sc->dc_revision < DC_REVISION_82C169)
-/* $OpenBSD: if_nep.c,v 1.27 2017/01/22 10:17:38 dlg Exp $ */
+/* $OpenBSD: if_nep.c,v 1.28 2017/04/09 18:16:00 dhill Exp $ */
/*
* Copyright (c) 2014, 2015 Mark Kettenis
*
return;
sc->sc_rbdesc = NEP_DMA_KVA(sc->sc_rbring);
- sc->sc_rb = malloc(sizeof(struct nep_block) * NEP_NRBDESC,
+ sc->sc_rb = malloc(NEP_NRBDESC, sizeof(struct nep_block),
M_DEVBUF, M_WAITOK);
for (i = 0; i < NEP_NRBDESC; i++) {
rb = &sc->sc_rb[i];
goto free_rxmbox;
sc->sc_txdesc = NEP_DMA_KVA(sc->sc_txring);
- sc->sc_txbuf = malloc(sizeof(struct nep_buf) * NEP_NTXDESC,
+ sc->sc_txbuf = mallocarray(NEP_NTXDESC, sizeof(struct nep_buf),
M_DEVBUF, M_WAITOK);
for (i = 0; i < NEP_NTXDESC; i++) {
txb = &sc->sc_txbuf[i];