wifi: ath10k: reset pointer after memory free to avoid potential use-after-free
authorWen Gong <quic_wgong@quicinc.com>
Tue, 20 Sep 2022 15:23:54 +0000 (18:23 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 22 Sep 2022 07:18:06 +0000 (10:18 +0300)
commit1e1cb8e0b73e6f39a9d4a7a15d940b1265387eb5
tree64dbc924cf918e19078399d7af1d793ba3a9e6ed
parenta20ed60bb357776301c2dad7b4a4f0db97e143e9
wifi: ath10k: reset pointer after memory free to avoid potential use-after-free

When running suspend test, kernel crash happened in ath10k, and it is
fixed by commit b72a4aff947b ("ath10k: skip ath10k_halt during suspend
for driver state RESTARTING").

Currently the crash is fixed, but as a common code style, it is better
to set the pointer to NULL after memory is free.

This is to address the code style and it will avoid potential bug of
use-after-free.

Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220505092248.787-1-quic_wgong@quicinc.com
drivers/net/wireless/ath/ath10k/htt_rx.c