summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_em.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-09-01 07:09:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-09-01 07:09:56 +0000
commit4be69151bd200b0731a3309b2fff9bd680468376 (patch)
treed756055461afc0190aea1eac979c76cb32b2b492 /sys/dev/pci/if_em.c
parent86cdc44383743a01103529350171fcb076a28312 (diff)
sizes for free(), mostly related to firmwares.
ok dlg
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r--sys/dev/pci/if_em.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index dace553b0dd..5c2d4351d67 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.301 2015/08/26 09:17:20 kettenis Exp $ */
+/* $OpenBSD: if_em.c,v 1.302 2015/09/01 07:09:55 deraadt Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -2308,7 +2308,8 @@ em_free_transmit_structures(struct em_softc *sc)
}
}
if (sc->tx_buffer_area != NULL) {
- free(sc->tx_buffer_area, M_DEVBUF, 0);
+ free(sc->tx_buffer_area, M_DEVBUF,
+ sc->num_tx_desc * sizeof(struct em_buffer));
sc->tx_buffer_area = NULL;
}
if (sc->txtag != NULL)
@@ -2768,7 +2769,8 @@ em_free_receive_structures(struct em_softc *sc)
}
}
if (sc->rx_buffer_area != NULL) {
- free(sc->rx_buffer_area, M_DEVBUF, 0);
+ free(sc->rx_buffer_area, M_DEVBUF,
+ sc->num_tx_desc * sizeof(struct em_buffer));
sc->rx_buffer_area = NULL;
}
if (sc->rxtag != NULL)