diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-01-13 16:35:03 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-01-17 12:54:57 +0100 |
commit | 0e8edb9aed03892844713bb76a8e1d2d138f3175 (patch) | |
tree | 29f9fcbf48871c1c807d28c7f5453f0cee0b99f5 /drivers/net/wireless/marvell | |
parent | mwifiex: get rid of global save_adapter and sdio_work (diff) | |
download | linux-0e8edb9aed03892844713bb76a8e1d2d138f3175.tar.xz linux-0e8edb9aed03892844713bb76a8e1d2d138f3175.zip |
mwifiex: fix uninitialized variable access in pcie_remove
Checking the firmware status from PCIe register only works
if the register is available, otherwise we end up with
random behavior:
drivers/net/wireless/marvell/mwifiex/pcie.c: In function 'mwifiex_pcie_remove':
drivers/net/wireless/marvell/mwifiex/pcie.c:585:5: error: 'fw_status' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This makes sure we treat the absence of the register as a failure.
Fixes: 045f0c1b5e26 ("mwifiex: get rid of global user_rmmod flag")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell')
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/pcie.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index 66226c615be0..4d78087ea13a 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -299,6 +299,8 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev) reg = card->pcie.reg; if (reg) ret = mwifiex_read_reg(adapter, reg->fw_status, &fw_status); + else + fw_status = -1; if (fw_status == FIRMWARE_READY_PCIE && !adapter->mfg_mode) { mwifiex_deauthenticate_all(adapter); |