From 65046b4042316d845525390be31015351a300164 Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 3 Jan 2018 08:43:10 +0000 Subject: [PATCH] Add size for free(9) in the bwfm(4) PCI attachment code. From Michael W. Bombardieri --- sys/dev/pci/if_bwfm_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c index 9e9be80a119..a36aba4d8e5 100644 --- a/sys/dev/pci/if_bwfm_pci.c +++ b/sys/dev/pci/if_bwfm_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_pci.c,v 1.3 2018/01/01 22:41:56 patrick Exp $ */ +/* $OpenBSD: if_bwfm_pci.c,v 1.4 2018/01/03 08:43:10 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt @@ -752,7 +752,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, bdm->bdm_map); bdmfree: - free(bdm, M_DEVBUF, 0); + free(bdm, M_DEVBUF, sizeof(*bdm)); return (NULL); } @@ -763,7 +763,7 @@ bwfm_pci_dmamem_free(struct bwfm_pci_softc *sc, struct bwfm_pci_dmamem *bdm) bus_dmamem_unmap(sc->sc_dmat, bdm->bdm_kva, bdm->bdm_size); bus_dmamem_free(sc->sc_dmat, &bdm->bdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, bdm->bdm_map); - free(bdm, M_DEVBUF, 0); + free(bdm, M_DEVBUF, sizeof(*bdm)); } /* -- 2.20.1