diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2009-06-02 16:28:22 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2009-06-02 16:28:22 +0000 |
commit | e667b1646ee9bf66f437bc13b4b414c9c64fefca (patch) | |
tree | bc3a2ea739299e2e65a0fa1254d5400b9b4ef55e /sys/dev/pci/if_iwn.c | |
parent | 4627ce407130157b9e27445ad350deba458943b7 (diff) |
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.
Diffstat (limited to 'sys/dev/pci/if_iwn.c')
-rw-r--r-- | sys/dev/pci/if_iwn.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 <damien.bergamini@free.fr> @@ -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; |