aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@iki.fi>2010-01-23 13:27:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-23 16:47:00 -0500
commit3b43a18743421cccd33902e29016fa49b2d52dbb (patch)
treeeaaab22a16260625854a51076fe64d5787e98ac4 /net
parentf12553ebe045a8a40ab33fa500fb57d10706e226 (diff)
mac80211: fix tx select key null pointer crash with hostapd
Pavel Roskin reported a crash in ieee80211_tx_h_select_key(): http://marc.info/?l=linux-wireless&m=126419655108528&w=2 This is a regression from patch "mac80211: move control.hw_key assignment". Fix it as suggested by Johannes, adding an else statement to make sure that tx->key is not accessed when it's null. Compile-tested only. Reported-by: Pavel Roskin <proski@gnu.org> Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Kalle Valo <kalle.valo@iki.fi> Tested-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/tx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index fcfa988a37a3..d017b3530d4d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -547,9 +547,10 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
547 !ieee80211_use_mfp(hdr->frame_control, tx->sta, 547 !ieee80211_use_mfp(hdr->frame_control, tx->sta,
548 tx->skb)) 548 tx->skb))
549 tx->key = NULL; 549 tx->key = NULL;
550 skip_hw = (tx->key->conf.flags & 550 else
551 IEEE80211_KEY_FLAG_SW_MGMT) && 551 skip_hw = (tx->key->conf.flags &
552 ieee80211_is_mgmt(hdr->frame_control); 552 IEEE80211_KEY_FLAG_SW_MGMT) &&
553 ieee80211_is_mgmt(hdr->frame_control);
553 break; 554 break;
554 case ALG_AES_CMAC: 555 case ALG_AES_CMAC:
555 if (!ieee80211_is_mgmt(hdr->frame_control)) 556 if (!ieee80211_is_mgmt(hdr->frame_control))