diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index fa293feef935..d3576b07ea4a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1477,6 +1477,8 @@ static int sta_apply_parameters(struct ieee80211_local *local, } if (params->supported_rates && params->supported_rates_len) { + if (sband->band >= NUM_NL80211_BANDS) + return -EINVAL; ieee80211_parse_bitrates(&sdata->vif.bss_conf.chandef, sband, params->supported_rates, params->supported_rates_len, diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 91bf32af55e9..8a6a56ed1186 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c @@ -991,6 +991,8 @@ ieee80211_crypto_aes_cmac_256_encrypt(struct ieee80211_tx_data *tx) return TX_DROP; skb = skb_peek(&tx->skbs); + if (!skb) + return TX_DROP; info = IEEE80211_SKB_CB(skb); @@ -1136,6 +1138,8 @@ ieee80211_crypto_aes_gmac_encrypt(struct ieee80211_tx_data *tx) return TX_DROP; skb = skb_peek(&tx->skbs); + if (!skb) + return TX_DROP; info = IEEE80211_SKB_CB(skb);