mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-19 05:24:11 +00:00
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: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
aa331df0e5
commit
e89f7690a3
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||||
tcb_desc->hw_rate = txrate->hw_value;
|
if (txrate)
|
||||||
|
tcb_desc->hw_rate = txrate->hw_value;
|
||||||
|
else
|
||||||
|
tcb_desc->hw_rate = 0;
|
||||||
|
|
||||||
if (ieee80211_is_data(fc)) {
|
if (ieee80211_is_data(fc)) {
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue