summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_athn_usb.c
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2012-11-12 22:38:26 +0000
committermikeb <mikeb@openbsd.org>2012-11-12 22:38:26 +0000
commit33c953a9f3c1f33e53a78ac37d56a3494293d504 (patch)
treee0577ac3e1b8e8a662053cbba845b08c56ec941a /sys/dev/usb/if_athn_usb.c
parentmove some stuff around, do minor cleanup (diff)
downloadwireguard-openbsd-33c953a9f3c1f33e53a78ac37d56a3494293d504.tar.xz
wireguard-openbsd-33c953a9f3c1f33e53a78ac37d56a3494293d504.zip
protect rxeof path with an splnet; ok kettenis
Diffstat (limited to 'sys/dev/usb/if_athn_usb.c')
-rw-r--r--sys/dev/usb/if_athn_usb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c
index 27df663baaa..c967c7ffe25 100644
--- a/sys/dev/usb/if_athn_usb.c
+++ b/sys/dev/usb/if_athn_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_athn_usb.c,v 1.9 2012/11/10 14:35:06 mikeb Exp $ */
+/* $OpenBSD: if_athn_usb.c,v 1.10 2012/11/12 22:38:26 mikeb Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@@ -1665,6 +1665,7 @@ athn_usb_rx_frame(struct athn_usb_softc *usc, struct mbuf *m)
struct ar_htc_frame_hdr *htc;
struct ar_rx_status *rs;
uint16_t datalen;
+ int s;
if (__predict_false(m->m_len < sizeof(*htc)))
goto skip;
@@ -1695,6 +1696,8 @@ athn_usb_rx_frame(struct athn_usb_softc *usc, struct mbuf *m)
m_adj(m, sizeof(*rs)); /* Strip Rx status. */
m->m_pkthdr.rcvif = ifp;
+ s = splnet();
+
/* Grab a reference to the source node. */
wh = mtod(m, struct ieee80211_frame *);
ni = ieee80211_find_rxnode(ic, wh);
@@ -1722,6 +1725,7 @@ athn_usb_rx_frame(struct athn_usb_softc *usc, struct mbuf *m)
/* Node is no longer needed. */
ieee80211_release_node(ic, ni);
+ splx(s);
return;
skip:
m_freem(m);