diff options
| author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-13 22:30:30 +0000 |
|---|---|---|
| committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2018-01-13 22:30:30 +0000 |
| commit | 26c1d774b55c4db79bca772941883244986e6f44 (patch) | |
| tree | 0d4a99e9eba470c0808a66d7d3f857c9f36446fa /sys/dev/iwi | |
| parent | a019e26c0f76f5fd5c401cd87554ef2d5efc36ca (diff) | |
Notes
Diffstat (limited to 'sys/dev/iwi')
| -rw-r--r-- | sys/dev/iwi/if_iwi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 43950a8c608c..71a017e3fcb5 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -640,7 +640,7 @@ iwi_alloc_tx_ring(struct iwi_softc *sc, struct iwi_tx_ring *ring, int count, goto fail; } - ring->data = malloc(count * sizeof (struct iwi_tx_data), M_DEVBUF, + ring->data = mallocarray(count, sizeof(struct iwi_tx_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); @@ -748,7 +748,7 @@ iwi_alloc_rx_ring(struct iwi_softc *sc, struct iwi_rx_ring *ring, int count) ring->count = count; ring->cur = 0; - ring->data = malloc(count * sizeof (struct iwi_rx_data), M_DEVBUF, + ring->data = mallocarray(count, sizeof(struct iwi_rx_data), M_DEVBUF, M_NOWAIT | M_ZERO); if (ring->data == NULL) { device_printf(sc->sc_dev, "could not allocate soft data\n"); |
