diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-01 07:09:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-01 07:09:56 +0000 |
commit | 4be69151bd200b0731a3309b2fff9bd680468376 (patch) | |
tree | d756055461afc0190aea1eac979c76cb32b2b492 /sys/dev/pci/if_ix.c | |
parent | 86cdc44383743a01103529350171fcb076a28312 (diff) |
sizes for free(), mostly related to firmwares.
ok dlg
Diffstat (limited to 'sys/dev/pci/if_ix.c')
-rw-r--r-- | sys/dev/pci/if_ix.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index bb53228ad3c..95877a92a63 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.122 2015/08/29 17:40:09 kettenis Exp $ */ +/* $OpenBSD: if_ix.c,v 1.123 2015/09/01 07:09:55 deraadt Exp $ */ /****************************************************************************** @@ -303,7 +303,8 @@ err_late: ixgbe_free_receive_structures(sc); err_out: ixgbe_free_pci_resources(sc); - free(sc->mta, M_DEVBUF, 0); + free(sc->mta, M_DEVBUF, IXGBE_ETH_LENGTH_OF_ADDRESS * + MAX_NUM_MULTICAST_ADDRESSES); } /********************************************************************* @@ -341,7 +342,8 @@ ixgbe_detach(struct device *self, int flags) ixgbe_free_transmit_structures(sc); ixgbe_free_receive_structures(sc); - free(sc->mta, M_DEVBUF, 0); + free(sc->mta, M_DEVBUF, IXGBE_ETH_LENGTH_OF_ADDRESS * + MAX_NUM_MULTICAST_ADDRESSES); return (0); } @@ -1793,10 +1795,10 @@ err_rx_desc: err_tx_desc: for (txr = sc->tx_rings; txconf > 0; txr++, txconf--) ixgbe_dma_free(sc, &txr->txdma); - free(sc->rx_rings, M_DEVBUF, 0); + free(sc->rx_rings, M_DEVBUF, sc->num_queues * sizeof(struct rx_ring)); sc->rx_rings = NULL; rx_fail: - free(sc->tx_rings, M_DEVBUF, 0); + free(sc->tx_rings, M_DEVBUF, sc->num_queues * sizeof(struct tx_ring)); sc->tx_rings = NULL; fail: return (ENOMEM); @@ -2030,7 +2032,8 @@ ixgbe_free_transmit_buffers(struct tx_ring *txr) } if (txr->tx_buffers != NULL) - free(txr->tx_buffers, M_DEVBUF, 0); + free(txr->tx_buffers, M_DEVBUF, + sc->num_queues * sizeof(struct tx_ring)); txr->tx_buffers = NULL; txr->txtag = NULL; } @@ -2791,7 +2794,8 @@ ixgbe_free_receive_buffers(struct rx_ring *rxr) bus_dmamap_destroy(rxr->rxdma.dma_tag, rxbuf->map); rxbuf->map = NULL; } - free(rxr->rx_buffers, M_DEVBUF, 0); + free(rxr->rx_buffers, M_DEVBUF, + sc->num_queues * sizeof(struct rx_ring)); rxr->rx_buffers = NULL; } } |