summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2017-05-18 08:35:57 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2017-05-18 08:35:57 +0000
commitec5278c6afcf92a3726b99c0f9f8c3e34ab36bb0 (patch)
tree741be767a5f1d75a6dbcf0aa4cf4e1317e858753 /sys/dev/ic
parent0fa1c0241b2e2aee5991c242ced52139edd081d6 (diff)
Fix a uvm fault in athn_clock_rate():
Don't deref an IEEE80211_CHAN_ANYC channel pointer. ok mpi@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/athn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
index 2b67ad2d1b1..806325a1c14 100644
--- a/sys/dev/ic/athn.c
+++ b/sys/dev/ic/athn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: athn.c,v 1.96 2017/01/17 20:07:39 stsp Exp $ */
+/* $OpenBSD: athn.c,v 1.97 2017/05/18 08:35:56 stsp Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -2597,7 +2597,8 @@ athn_clock_rate(struct athn_softc *sc)
struct ieee80211com *ic = &sc->sc_ic;
int clockrate; /* MHz. */
- if (IEEE80211_IS_CHAN_5GHZ(ic->ic_bss->ni_chan)) {
+ if (ic->ic_bss->ni_chan != IEEE80211_CHAN_ANYC &&
+ IEEE80211_IS_CHAN_5GHZ(ic->ic_bss->ni_chan)) {
if (sc->flags & ATHN_FLAG_FAST_PLL_CLOCK)
clockrate = AR_CLOCK_RATE_FAST_5GHZ_OFDM;
else