Skip to content

Commit

Permalink
rsi: fix null pointer dereference during rsi_shutdown()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
merge authored and Kalle Valo committed Feb 12, 2020
1 parent 8299ade commit 16bbc3e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/wireless/rsi/rsi_91x_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 16bbc3e

Please sign in to comment.