diff options
author | 2009-06-02 16:24:40 +0000 | |
---|---|---|
committer | 2009-06-02 16:24:40 +0000 | |
commit | 7d7ae90b2e785f59901ce36427ceda7f1367b2cd (patch) | |
tree | c70f26a97c9f24c229091177a3d3d0cbfd7e8145 /sys | |
parent | Add '-h' flag, and '*' as a unit specifier for 'p' Editor command. (diff) | |
download | wireguard-openbsd-7d7ae90b2e785f59901ce36427ceda7f1367b2cd.tar.xz wireguard-openbsd-7d7ae90b2e785f59901ce36427ceda7f1367b2cd.zip |
make sure the channel's subband is found in iwn4965_set_txpower().
found by "Parfait".
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_iwn.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 2fff50a85fe..183a41501b0 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.57 2009/05/29 08:25:45 damien Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.58 2009/06/02 16:24:40 damien Exp $ */ /*- * Copyright (c) 2007-2009 Damien Bergamini <damien.bergamini@free.fr> @@ -3212,6 +3212,8 @@ iwn4965_set_txpower(struct iwn_softc *sc, int async) if (sc->bands[i].lo != 0 && sc->bands[i].lo <= chan && chan <= sc->bands[i].hi) break; + if (i == IWN_NBANDS) /* Can't happen in real-life. */ + return EINVAL; chans = sc->bands[i].chans; DPRINTF(("chan %d sub-band=%d\n", chan, i)); |