]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: rtw89: correct use sequence of driver_data in skb->info
authorPing-Ke Shih <pkshih@realtek.com>
Wed, 17 Dec 2025 07:26:46 +0000 (15:26 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 23 Dec 2025 03:50:33 +0000 (11:50 +0800)
commitd3a9e132a4c6273a5254e743da14887502e928c8
treeff3040cc797ab643807f6576a7653a0f1cd8a323
parenta2f1fc9ab6fb0d5c9d701a516c342944258fb20e
wifi: rtw89: correct use sequence of driver_data in skb->info

As ieee80211_tx_info is used to assist filling TX descriptor, and layout of
IEEE80211_SKB_CB(skb)->driver_data (accessing by RTW89_TX_SKB_CB()) is
union, so driver_data must be used by/after rtw89_hci_tx_write() or just
before calling rtw89_hci_tx_write(). Otherwise, ieee80211_tx_info::control
data is overwritten.

Found this by using injected packets which uses ieee80211_tx_info::control,
but always sending incorrect data rate.

Cc: Fedor Pchelkin <pchelkin@ispras.ru>
Fixes: d5da3d9fb05f ("wifi: rtw89: process TX wait skbs for USB via C2H handler")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Fedor Pchelkin <pchelkin@ispras.ru>
Link: https://patch.msgid.link/20251217072646.43209-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h