Skip to content

Commit 54b5172

Browse files
Sanjay Kumar KonduriKalle Valo
authored andcommitted
rsi: Add null check for virtual interfaces in wowlan config
When the "poweroff" command is executed after wowlan enabled, we have observed a system crash. In the system "poweroff" sequence, network-manager is sent to inactive state by cleaning up the network interfaces, using rsi_mac80211_remove_interface() and when driver tries to access those network interfaces in rsi_wowlan_config() which was invoked by SDIO shutdown, results in a crash. Added a NULL check before accessing the network interfaces in rsi_wowlan_config(). Signed-off-by: Sanjay Kumar Konduri <[email protected]> Signed-off-by: Siva Rebbagondla <[email protected]> Signed-off-by: Sushant Kumar Mishra <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 1204aa1 commit 54b5172

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/wireless/rsi/rsi_91x_mac80211.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,10 +1804,15 @@ int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan)
18041804
struct rsi_common *common = adapter->priv;
18051805
u16 triggers = 0;
18061806
u16 rx_filter_word = 0;
1807-
struct ieee80211_bss_conf *bss = &adapter->vifs[0]->bss_conf;
1807+
struct ieee80211_bss_conf *bss = NULL;
18081808

18091809
rsi_dbg(INFO_ZONE, "Config WoWLAN to device\n");
18101810

1811+
if (!adapter->vifs[0])
1812+
return -EINVAL;
1813+
1814+
bss = &adapter->vifs[0]->bss_conf;
1815+
18111816
if (WARN_ON(!wowlan)) {
18121817
rsi_dbg(ERR_ZONE, "WoW triggers not enabled\n");
18131818
return -EINVAL;

0 commit comments

Comments
 (0)