summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwn.c
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2009-06-02 16:28:22 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2009-06-02 16:28:22 +0000
commite667b1646ee9bf66f437bc13b4b414c9c64fefca (patch)
treebc3a2ea739299e2e65a0fa1254d5400b9b4ef55e /sys/dev/pci/if_iwn.c
parent4627ce407130157b9e27445ad350deba458943b7 (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.c5
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;