Commit 16bbc3eb authored by Martin Kepplinger's avatar Martin Kepplinger Committed by Kalle Valo
Browse files

rsi: fix null pointer dereference during rsi_shutdown()



Appearently the hw pointer can be NULL while the module is loaded and
in that case rsi_shutdown() crashes due to the unconditional dereference.

Signed-off-by: default avatarMartin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 8299adec
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1468,12 +1468,15 @@ static void rsi_shutdown(struct device *dev)
	struct rsi_91x_sdiodev *sdev =
		(struct rsi_91x_sdiodev *)adapter->rsi_dev;
	struct ieee80211_hw *hw = adapter->hw;
	struct cfg80211_wowlan *wowlan = hw->wiphy->wowlan_config;

	rsi_dbg(ERR_ZONE, "SDIO Bus shutdown =====>\n");

	if (hw) {
		struct cfg80211_wowlan *wowlan = hw->wiphy->wowlan_config;

		if (rsi_config_wowlan(adapter, wowlan))
			rsi_dbg(ERR_ZONE, "Failed to configure WoWLAN\n");
	}

	if (IS_ENABLED(CONFIG_RSI_COEX) && adapter->priv->coex_mode > 1 &&
	    adapter->priv->bt_adapter) {