mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled
[ Upstream commitb241e26082
] In case WoWlan was never configured during the operation of the system, the hw->wiphy->wowlan_config will be NULL. rsi_config_wowlan() checks whether wowlan_config is non-NULL and if it is not, then WARNs about it. The warning is valid, as during normal operation the rsi_config_wowlan() should only ever be called with non-NULL wowlan_config. In shutdown this rsi_config_wowlan() should only ever be called if WoWlan was configured before by the user. Add checks for non-NULL wowlan_config into the shutdown hook. While at it, check whether the wiphy is also non-NULL before accessing wowlan_config . Drop the single-use wowlan_config variable, just inline it into function call. Fixes:16bbc3eb83
("rsi: fix null pointer dereference during rsi_shutdown()") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230527222833.273741-1-marex@denx.de Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b4b1db7aa3
commit
1b51236aa4
1 changed files with 2 additions and 4 deletions
|
@ -1463,10 +1463,8 @@ static void rsi_shutdown(struct device *dev)
|
|||
|
||||
rsi_dbg(ERR_ZONE, "SDIO Bus shutdown =====>\n");
|
||||
|
||||
if (hw) {
|
||||
struct cfg80211_wowlan *wowlan = hw->wiphy->wowlan_config;
|
||||
|
||||
if (rsi_config_wowlan(adapter, wowlan))
|
||||
if (hw && hw->wiphy && hw->wiphy->wowlan_config) {
|
||||
if (rsi_config_wowlan(adapter, hw->wiphy->wowlan_config))
|
||||
rsi_dbg(ERR_ZONE, "Failed to configure WoWLAN\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue