Commit eb2c6ca2 authored by Tom Rix's avatar Tom Rix Committed by Kalle Valo

mwifiex: remove function pointer check

clang static analyzer reports this problem

init.c:739:8: warning: Called function pointer
  is null (null dereference)
        ret = adapter->if_ops.check_fw_status( ...
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In mwifiex_dnld_fw, there is an earlier check for check_fw_status(),
The check was introduced for usb support at the same time this
check in _mwifiex_fw_dpc() was made

	if (adapter->if_ops.dnld_fw) {
		ret = adapter->if_ops.dnld_fw(adapter, &fw);
	} else {
		ret = mwifiex_dnld_fw(adapter, &fw);
	}

And a dnld_fw function initialized as part the usb's
mwifiex_if_ops.

The other instances of mwifiex_if_ops for pci and sdio
both set check_fw_status.

So the first check is not needed and can be removed.

Fixes: 4daffe35 ("mwifiex: add support for Marvell USB8797 chipset")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200906200548.18053-1-trix@redhat.com
parent 86279456
...@@ -695,14 +695,12 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, ...@@ -695,14 +695,12 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter,
int ret; int ret;
u32 poll_num = 1; u32 poll_num = 1;
if (adapter->if_ops.check_fw_status) { /* check if firmware is already running */
/* check if firmware is already running */ ret = adapter->if_ops.check_fw_status(adapter, poll_num);
ret = adapter->if_ops.check_fw_status(adapter, poll_num); if (!ret) {
if (!ret) { mwifiex_dbg(adapter, MSG,
mwifiex_dbg(adapter, MSG, "WLAN FW already running! Skip FW dnld\n");
"WLAN FW already running! Skip FW dnld\n"); return 0;
return 0;
}
} }
/* check if we are the winner for downloading FW */ /* check if we are the winner for downloading FW */
......
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