Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54b51720 authored by Sanjay Kumar Konduri's avatar Sanjay Kumar Konduri Committed by Kalle Valo
Browse files

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: default avatarSanjay Kumar Konduri <sanjay.konduri@redpinesignals.com>
Signed-off-by: default avatarSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: default avatarSushant Kumar Mishra <sushant.mishra@redpinesignals.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 1204aa17
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1804,10 +1804,15 @@ int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan)
	struct rsi_common *common = adapter->priv;
	u16 triggers = 0;
	u16 rx_filter_word = 0;
	struct ieee80211_bss_conf *bss = &adapter->vifs[0]->bss_conf;
	struct ieee80211_bss_conf *bss = NULL;

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

	if (!adapter->vifs[0])
		return -EINVAL;

	bss = &adapter->vifs[0]->bss_conf;

	if (WARN_ON(!wowlan)) {
		rsi_dbg(ERR_ZONE, "WoW triggers not enabled\n");
		return -EINVAL;