Commit 2c4e9acb authored by Dmitry Antipov's avatar Dmitry Antipov Committed by Kalle Valo

wifi: rtlwifi: simplify rtl_action_proc() and rtl_tx_agg_start()

Since 'drv_priv' is an in-place member allocated at the end of
'struct ieee80211_sta', it can't be NULL and so relevant checks
in 'rtl_action_proc()' and 'rtl_tx_agg_start()' may be dropped.
Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Acked-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231113144734.197359-2-dmantipov@yandex.ru
parent 0a78bb64
...@@ -1402,10 +1402,6 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) ...@@ -1402,10 +1402,6 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
sta_entry = sta_entry =
(struct rtl_sta_info *)sta->drv_priv; (struct rtl_sta_info *)sta->drv_priv;
if (!sta_entry) {
rcu_read_unlock();
return true;
}
capab = capab =
le16_to_cpu(mgmt->u.action.u.addba_req.capab); le16_to_cpu(mgmt->u.action.u.addba_req.capab);
tid = (capab & tid = (capab &
...@@ -1760,8 +1756,6 @@ int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -1760,8 +1756,6 @@ int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
return -EINVAL; return -EINVAL;
sta_entry = (struct rtl_sta_info *)sta->drv_priv; sta_entry = (struct rtl_sta_info *)sta->drv_priv;
if (!sta_entry)
return -ENXIO;
tid_data = &sta_entry->tids[tid]; tid_data = &sta_entry->tids[tid];
rtl_dbg(rtlpriv, COMP_SEND, DBG_DMESG, rtl_dbg(rtlpriv, COMP_SEND, DBG_DMESG,
...@@ -1818,8 +1812,6 @@ int rtl_rx_agg_start(struct ieee80211_hw *hw, ...@@ -1818,8 +1812,6 @@ int rtl_rx_agg_start(struct ieee80211_hw *hw,
} }
sta_entry = (struct rtl_sta_info *)sta->drv_priv; sta_entry = (struct rtl_sta_info *)sta->drv_priv;
if (!sta_entry)
return -ENXIO;
tid_data = &sta_entry->tids[tid]; tid_data = &sta_entry->tids[tid];
rtl_dbg(rtlpriv, COMP_RECV, DBG_DMESG, rtl_dbg(rtlpriv, COMP_RECV, DBG_DMESG,
......
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