Skip to content

Commit 2c4e9ac

Browse files
dmantipovKalle Valo
authored andcommitted
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: Dmitry Antipov <[email protected]> Acked-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0a78bb6 commit 2c4e9ac

File tree

1 file changed

+0
-8
lines changed
  • drivers/net/wireless/realtek/rtlwifi

1 file changed

+0
-8
lines changed

drivers/net/wireless/realtek/rtlwifi/base.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,10 +1402,6 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
14021402

14031403
sta_entry =
14041404
(struct rtl_sta_info *)sta->drv_priv;
1405-
if (!sta_entry) {
1406-
rcu_read_unlock();
1407-
return true;
1408-
}
14091405
capab =
14101406
le16_to_cpu(mgmt->u.action.u.addba_req.capab);
14111407
tid = (capab &
@@ -1760,8 +1756,6 @@ int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
17601756
return -EINVAL;
17611757

17621758
sta_entry = (struct rtl_sta_info *)sta->drv_priv;
1763-
if (!sta_entry)
1764-
return -ENXIO;
17651759
tid_data = &sta_entry->tids[tid];
17661760

17671761
rtl_dbg(rtlpriv, COMP_SEND, DBG_DMESG,
@@ -1818,8 +1812,6 @@ int rtl_rx_agg_start(struct ieee80211_hw *hw,
18181812
}
18191813

18201814
sta_entry = (struct rtl_sta_info *)sta->drv_priv;
1821-
if (!sta_entry)
1822-
return -ENXIO;
18231815
tid_data = &sta_entry->tids[tid];
18241816

18251817
rtl_dbg(rtlpriv, COMP_RECV, DBG_DMESG,

0 commit comments

Comments
 (0)