Commit e89f7690 authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

rtlwifi: Fix oops on rate-control failure

When the rate-control indexing is incorrectly set up, mac80211 issues
a warning and returns NULL from the call to ieee80211_get_tx_rate().
When this happens, avoid a NULL pointer dereference.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent aa331df0
...@@ -838,7 +838,10 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, ...@@ -838,7 +838,10 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw,
__le16 fc = hdr->frame_control; __le16 fc = hdr->frame_control;
txrate = ieee80211_get_tx_rate(hw, info); txrate = ieee80211_get_tx_rate(hw, info);
if (txrate)
tcb_desc->hw_rate = txrate->hw_value; tcb_desc->hw_rate = txrate->hw_value;
else
tcb_desc->hw_rate = 0;
if (ieee80211_is_data(fc)) { if (ieee80211_is_data(fc)) {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment