ath9k: check for NULL rate when using ieee80211_get_rts_cts_rate()
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Tue, 15 Oct 2013 00:42:10 +0000 (17:42 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 18 Oct 2013 18:04:41 +0000 (14:04 -0400)
ieee80211_get_rts_cts_rate() can return NULL, so don't rely
on its members when it does return NULL.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/xmit.c

index fc76052c072114df5154d6200ce9d0f45aac5346..6bcf62fd3da8bf2ec4ce133ef70b00745e211df0 100644 (file)
@@ -2006,6 +2006,9 @@ static void setup_frame_info(struct ieee80211_hw *hw,
                fi->keyix = ATH9K_TXKEYIX_INVALID;
        fi->keytype = keytype;
        fi->framelen = framelen;
+
+       if (!rate)
+               return;
        fi->rtscts_rate = rate->hw_value;
        if (short_preamble)
                fi->rtscts_rate |= rate->hw_value_short;