dev/bxe: make use of mallocarray(9).
Use mallocarray in a couple of cases where a calloc-like operation is taking place.
This commit is contained in:
parent
802258f46b
commit
c93a33340f
@ -12018,7 +12018,8 @@ bxe_set_mc_list(struct bxe_softc *sc)
|
||||
}
|
||||
bzero(mta, (sizeof(unsigned char) * ETHER_ADDR_LEN * mc_count));
|
||||
|
||||
mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, (M_NOWAIT | M_ZERO));
|
||||
mc_mac = mallocarray(mc_count, sizeof(*mc_mac), M_DEVBUF,
|
||||
(M_NOWAIT | M_ZERO));
|
||||
mc_mac_start = mc_mac;
|
||||
|
||||
if (!mc_mac) {
|
||||
|
@ -159,7 +159,7 @@ typedef struct mtx ECORE_MUTEX_SPIN;
|
||||
malloc(_size, M_TEMP, (M_NOWAIT | M_ZERO))
|
||||
|
||||
#define ECORE_CALLOC(_len, _size, _flags, _sc) \
|
||||
malloc(_len * _size, M_TEMP, (M_NOWAIT | M_ZERO))
|
||||
mallocarray(_len, _size, M_TEMP, (M_NOWAIT | M_ZERO))
|
||||
|
||||
#define ECORE_FREE(_s, _buf, _size) free(_buf, M_TEMP)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user