diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-07-13 23:10:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-07-13 23:10:24 +0000 |
commit | 7ed78303cb18e6b98d376eb01f6a79bcf6211a0f (patch) | |
tree | b074a2500bf5c87060c6ac6a7480e99344143a86 /sys/dev/pci/if_ixgb.c | |
parent | eede121c340508412e23b0664274f4a9e38bc272 (diff) |
Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishian
ok tedu
Diffstat (limited to 'sys/dev/pci/if_ixgb.c')
-rw-r--r-- | sys/dev/pci/if_ixgb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c index 01177056862..cac1a736a66 100644 --- a/sys/dev/pci/if_ixgb.c +++ b/sys/dev/pci/if_ixgb.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_ixgb.c,v 1.61 2014/07/12 18:48:51 tedu Exp $ */ +/* $OpenBSD: if_ixgb.c,v 1.62 2014/07/13 23:10:23 deraadt Exp $ */ #include <dev/pci/if_ixgb.h> @@ -1135,8 +1135,8 @@ ixgb_dma_free(struct ixgb_softc *sc, struct ixgb_dma_alloc *dma) int ixgb_allocate_transmit_structures(struct ixgb_softc *sc) { - if (!(sc->tx_buffer_area = malloc(sizeof(struct ixgb_buffer) * - sc->num_tx_desc, M_DEVBUF, M_NOWAIT | M_ZERO))) { + if (!(sc->tx_buffer_area = mallocarray(sc->num_tx_desc, + sizeof(struct ixgb_buffer), M_DEVBUF, M_NOWAIT | M_ZERO))) { printf("%s: Unable to allocate tx_buffer memory\n", sc->sc_dv.dv_xname); return (ENOMEM); @@ -1501,8 +1501,8 @@ ixgb_allocate_receive_structures(struct ixgb_softc *sc) int i, error; struct ixgb_buffer *rx_buffer; - if (!(sc->rx_buffer_area = malloc(sizeof(struct ixgb_buffer) * - sc->num_rx_desc, M_DEVBUF, M_NOWAIT | M_ZERO))) { + if (!(sc->rx_buffer_area = mallocarray(sc->num_rx_desc, + sizeof(struct ixgb_buffer), M_DEVBUF, M_NOWAIT | M_ZERO))) { printf("%s: Unable to allocate rx_buffer memory\n", sc->sc_dv.dv_xname); return (ENOMEM); |