Skip to content

Commit

Permalink
rtw89: don't kick off TX DMA if failed to write skb
Browse files Browse the repository at this point in the history
[ Upstream commit a58fdb7 ]

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.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211201093816.13806-1-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Ping-Ke Shih authored and gregkh committed Jan 27, 2022
1 parent 4d5d7ff commit ce7eff5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/realtek/rtw89/mac80211.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit ce7eff5

Please sign in to comment.