From: Luis R. Rodriguez Date: Tue, 15 Oct 2013 00:42:10 +0000 (-0700) Subject: ath9k: check for NULL rate when using ieee80211_get_rts_cts_rate() X-Git-Tag: v6.6-pxa1908~24370^2~55^2^2~36 X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=09b029b6b68daa4b961841173d90f267cee9c117;p=linux.git ath9k: check for NULL rate when using ieee80211_get_rts_cts_rate() 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 Signed-off-by: Luis R. Rodriguez Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index fc76052c0721..6bcf62fd3da8 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -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;