Commit f46a5b01 authored by Shawn Lin's avatar Shawn Lin Committed by Kalle Valo

mwifiex: fix compile warning of unused variable

We got a compile warning shows below:

drivers/net/wireless/marvell/mwifiex/sdio.c: In function
'mwifiex_sdio_remove':
drivers/net/wireless/marvell/mwifiex/sdio.c:377:6: warning: variable
'ret' set but not used [-Wunused-but-set-variable]

Per the code, it didn't check if mwifiex_sdio_read_fw_status
finish successfully. We should at least check the return of
mwifiex_sdio_read_fw_status, otherwise the following check of
firmware_stat and adapter->mfg_mode is pointless as the device
is probably dead.
Signed-off-by: default avatarShawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 0bc03cfd
...@@ -390,7 +390,8 @@ mwifiex_sdio_remove(struct sdio_func *func) ...@@ -390,7 +390,8 @@ mwifiex_sdio_remove(struct sdio_func *func)
mwifiex_dbg(adapter, INFO, "info: SDIO func num=%d\n", func->num); mwifiex_dbg(adapter, INFO, "info: SDIO func num=%d\n", func->num);
ret = mwifiex_sdio_read_fw_status(adapter, &firmware_stat); ret = mwifiex_sdio_read_fw_status(adapter, &firmware_stat);
if (firmware_stat == FIRMWARE_READY_SDIO && !adapter->mfg_mode) { if (!ret && firmware_stat == FIRMWARE_READY_SDIO &&
!adapter->mfg_mode) {
mwifiex_deauthenticate_all(adapter); mwifiex_deauthenticate_all(adapter);
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment