Skip to contentSkip to conversation

rtw89: don't kick off TX DMA if failed to write skb

PATCH In review Ping-Ke Shih 2 participants 2 messages Dec 1, 2021 – Dec 8, 2021 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 rtw89: don't kick off TX DMA if failed to write skb

This is found by Smatch static checker warning:

	drivers/net/wireless/realtek/rtw89/mac80211.c:31 rtw89_ops_tx()
	error: uninitialized symbol 'qsel'.

The warning is because 'qsel' isn't filled by rtw89_core_tx_write() due to failed to write. The way to fix it is to avoid kicking off TX DMA, so add 'return' to the failure case.

---
 drivers/net/wireless/realtek/rtw89/mac80211.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtw89/mac80211.c +1 -0
index 16dc6fb7dbb0b..e9d61e55e2d92 100644
@@ -27,6 +27,7 @@ static void rtw89_ops_tx(struct ieee80211_hw *hw,
 	if (ret) {
 		rtw89_err(rtwdev, "failed to transmit skb: %d\n", ret);
 		ieee80211_free_txskb(hw, skb);
+		return;
 	}
 	rtw89_core_tx_kick_off(rtwdev, qsel);
 }
Signature · 1 line
2.25.1
#1 lore raw
Quoted 10 lines · Ping-Ke Shih

This is found by Smatch static checker warning:

	drivers/net/wireless/realtek/rtw89/mac80211.c:31 rtw89_ops_tx()
	error: uninitialized symbol 'qsel'.

The warning is because 'qsel' isn't filled by rtw89_core_tx_write() due to failed to write. The way to fix it is to avoid kicking off TX DMA, so add 'return' to the failure case.

Patch applied to wireless-drivers-next.git, thanks.

a58fdb7c843a rtw89: don't kick off TX DMA if failed to write skb

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches