diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 4f0cfb8cc682..18f5dc80de10 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -677,7 +677,7 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev, idx = erq->flags & IW_ENCODE_INDEX; if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) { - if (idx < 4 || idx > 5) { + if (idx < 5 || idx > 6) { idx = wdev->wext.default_mgmt_key; if (idx < 0) return -EINVAL;