[PATCH 3.16 106/132] rsi: add fix for crash during assertions

From: Ben Hutchings
Date: Fri Sep 20 2019 - 10:25:58 EST


3.16.74-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: Sanjay Konduri <sanjay.konduri@xxxxxxxxxxxxxxxxxx>

commit abd39c6ded9db53aa44c2540092bdd5fb6590fa8 upstream.

Observed crash in some scenarios when assertion has occurred,
this is because hw structure is freed and is tried to get
accessed in some functions where null check is already
present. So, avoided the crash by making the hw to NULL after
freeing.

Signed-off-by: Sanjay Konduri <sanjay.konduri@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Sushant Kumar Mishra <sushant.mishra@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -199,6 +199,7 @@ void rsi_mac80211_detach(struct rsi_hw *
ieee80211_stop_queues(hw);
ieee80211_unregister_hw(hw);
ieee80211_free_hw(hw);
+ adapter->hw = NULL;
}

rsi_remove_dbgfs(adapter);