From e667b1646ee9bf66f437bc13b4b414c9c64fefca Mon Sep 17 00:00:00 2001 From: Damien Bergamini Date: Tue, 2 Jun 2009 16:28:22 +0000 Subject: do not leak mbufs in the Rx path in case hardware decryption failed. this leak was introduced when i switched to MCLGETI. reported by mpf@ and others. --- sys/dev/pci/if_iwn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci/if_iwn.c') diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 183a41501b0..108c01cb08f 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.58 2009/06/02 16:24:40 damien Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.59 2009/06/02 16:28:21 damien Exp $ */ /*- * Copyright (c) 2007-2009 Damien Bergamini @@ -1767,6 +1767,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, if ((flags & IWN_RX_CIPHER_MASK) != IWN_RX_CIPHER_CCMP) { ic->ic_stats.is_ccmp_dec_errs++; ifp->if_ierrors++; + m_freem(m); return; } /* Check whether decryption was successful or not. */ @@ -1778,10 +1779,12 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, DPRINTF(("CCMP decryption failed 0x%x\n", flags)); ic->ic_stats.is_ccmp_dec_errs++; ifp->if_ierrors++; + m_freem(m); return; } if (iwn_ccmp_decap(sc, m, &ni->ni_pairwise_key) != 0) { ifp->if_ierrors++; + m_freem(m); return; } rxi.rxi_flags |= IEEE80211_RXI_HWDEC; -- cgit v1.2.3