UPSTREAM: ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait

The skb may be freed in tx completion context before
trace_ath10k_wmi_cmd is called. This can be easily captured when
KASAN(Kernel Address Sanitizer) is enabled. The fix is to move
trace_ath10k_wmi_cmd before the send operation. As the ret has no
meaning in trace_ath10k_wmi_cmd then, so remove this parameter too.

Signed-off-by: Carl Huang <>
Tested-by: Brian Norris <>
Reviewed-by: Brian Norris <>
Signed-off-by: Kalle Valo <>
(cherry picked from commit 9ef0f58ed7b4a55da4a64641d538e0d9e46579ac)

TEST=Enable KASAN kernel config and connect the device to AP

Change-Id: Iad62433cc1bee9de7480486a5d188f33322d26fc
Signed-off-by: Brian Norris <>
2 files changed