]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mwifiex: Properly initialize private structure on interface type changes
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 14 Sep 2021 19:59:08 +0000 (21:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:36:04 +0000 (11:36 +0100)
commit89d75fc9752b9871069cad162a92a2bdc2df8759
tree08eafbe652f6dc359746461ce48bbac8201ea2b8
parentdcfa20ad148979fd167cdc7e4e213fa1cc81d328
mwifiex: Properly initialize private structure on interface type changes

[ Upstream commit c606008b70627a2fc485732a53cc22f0f66d0981 ]

When creating a new virtual interface in mwifiex_add_virtual_intf(), we
update our internal driver states like bss_type, bss_priority, bss_role
and bss_mode to reflect the mode the firmware will be set to.

When switching virtual interface mode using
mwifiex_init_new_priv_params() though, we currently only update bss_mode
and bss_role. In order for the interface mode switch to actually work,
we also need to update bss_type to its proper value, so do that.

This fixes a crash of the firmware (because the driver tries to execute
commands that are invalid in AP mode) when switching from station mode
to AP mode.

Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210914195909.36035-9-verdre@v0yd.nl
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/marvell/mwifiex/cfg80211.c