Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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)) {
		/*
		/*