From 34df0755f7bf5ebc8bafb05b8bd34ebea8e99712 Mon Sep 17 00:00:00 2001 From: jmatthew Date: Tue, 9 Jan 2024 04:29:46 +0000 Subject: [PATCH] If there are still mbufs on a ring when we're freeing it, it'd be a good idea to free them too. ok dlg@ --- sys/dev/pci/if_bnxt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/if_bnxt.c b/sys/dev/pci/if_bnxt.c index f60b3ade1c3..dfd9392c417 100644 --- a/sys/dev/pci/if_bnxt.c +++ b/sys/dev/pci/if_bnxt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnxt.c,v 1.40 2024/01/04 07:08:47 jmatthew Exp $ */ +/* $OpenBSD: if_bnxt.c,v 1.41 2024/01/09 04:29:46 jmatthew Exp $ */ /*- * Broadcom NetXtreme-C/E network driver. * @@ -742,6 +742,8 @@ bnxt_free_slots(struct bnxt_softc *sc, struct bnxt_slot *slots, int allocated, while (i-- > 0) { bs = &slots[i]; bus_dmamap_destroy(sc->sc_dmat, bs->bs_map); + if (bs->bs_m != NULL) + m_freem(bs->bs_m); } free(slots, M_DEVBUF, total * sizeof(*bs)); } -- 2.20.1