summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rsi
diff options
context:
space:
mode:
authorMartin Kepplinger <martin.kepplinger@puri.sm>2020-01-29 14:02:59 +0100
committerKalle Valo <kvalo@codeaurora.org>2020-02-12 17:19:14 +0100
commit16bbc3eb83728c03138191a5d23d84d38175fa26 (patch)
tree5ad883d650ff4d31b6bf5051e2165c9dcc2af149 /drivers/net/wireless/rsi
parentrtw88: 8822c: update power sequence to v16 (diff)
downloadlinux-16bbc3eb83728c03138191a5d23d84d38175fa26.tar.xz
linux-16bbc3eb83728c03138191a5d23d84d38175fa26.zip
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: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/rsi')
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_sdio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
index 1bebba4e8527..5d6143a55187 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
@@ -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 (rsi_config_wowlan(adapter, wowlan))
- rsi_dbg(ERR_ZONE, "Failed to configure WoWLAN\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) {