All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling
@ 2023-10-20  9:46 Dmitry Antipov
  2023-10-20  9:46 ` [PATCH 2/2] wifi: mwifiex: remove unreachable code in mwifiex_sec_ioctl_set_wpa_key() Dmitry Antipov
  2023-10-23 16:37 ` [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling Brian Norris
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Antipov @ 2023-10-20  9:46 UTC (permalink / raw)
  To: Brian Norris; +Cc: Kalle Valo, linux-wireless, lvc-project, Dmitry Antipov

In 'mwifiex_sdio_generic_fw_dump()', move the check whether
'sdio_readb()' has failed for MAX_POLL_TRIES times out of
the reading loop. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/marvell/mwifiex/sdio.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 6462a0ffe698..d80bd3816e3c 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -2889,12 +2889,12 @@ static void mwifiex_sdio_generic_fw_dump(struct mwifiex_adapter *adapter)
 			}
 			if (start_flag == 0)
 				break;
-			if (tries == MAX_POLL_TRIES) {
-				mwifiex_dbg(adapter, ERROR,
-					    "FW not ready to dump\n");
-				ret = -1;
-				goto done;
-			}
+		}
+		if (tries == MAX_POLL_TRIES) {
+			mwifiex_dbg(adapter, ERROR,
+				    "FW not ready to dump\n");
+			ret = -1;
+			goto done;
 		}
 		usleep_range(100, 200);
 	}
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] wifi: mwifiex: remove unreachable code in mwifiex_sec_ioctl_set_wpa_key()
  2023-10-20  9:46 [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling Dmitry Antipov
@ 2023-10-20  9:46 ` Dmitry Antipov
  2023-10-23 16:37 ` [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling Brian Norris
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Antipov @ 2023-10-20  9:46 UTC (permalink / raw)
  To: Brian Norris; +Cc: Kalle Valo, linux-wireless, lvc-project, Dmitry Antipov

Since 'remove_key' is always false, remove unreachable block
in 'mwifiex_sec_ioctl_set_wpa_key()'. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index a2ad2b53f016..1b375a70cd1a 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -989,7 +989,6 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv,
 			      struct mwifiex_ds_encrypt_key *encrypt_key)
 {
 	int ret;
-	u8 remove_key = false;
 	struct host_cmd_ds_802_11_key_material *ibss_key;
 
 	/* Current driver only supports key length of up to 32 bytes */
@@ -1031,14 +1030,9 @@ static int mwifiex_sec_ioctl_set_wpa_key(struct mwifiex_private *priv,
 	if (!encrypt_key->key_index)
 		encrypt_key->key_index = MWIFIEX_KEY_INDEX_UNICAST;
 
-	if (remove_key)
-		ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_KEY_MATERIAL,
-				       HostCmd_ACT_GEN_SET,
-				       !KEY_INFO_ENABLED, encrypt_key, true);
-	else
-		ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_KEY_MATERIAL,
-				       HostCmd_ACT_GEN_SET,
-				       KEY_INFO_ENABLED, encrypt_key, true);
+	ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_KEY_MATERIAL,
+			       HostCmd_ACT_GEN_SET,
+			       KEY_INFO_ENABLED, encrypt_key, true);
 
 	return ret;
 }
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling
  2023-10-20  9:46 [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling Dmitry Antipov
  2023-10-20  9:46 ` [PATCH 2/2] wifi: mwifiex: remove unreachable code in mwifiex_sec_ioctl_set_wpa_key() Dmitry Antipov
@ 2023-10-23 16:37 ` Brian Norris
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2023-10-23 16:37 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: Kalle Valo, linux-wireless, lvc-project

On Fri, Oct 20, 2023 at 2:47 AM Dmitry Antipov <dmantipov@yandex.ru> wrote:
>
> In 'mwifiex_sdio_generic_fw_dump()', move the check whether
> 'sdio_readb()' has failed for MAX_POLL_TRIES times out of
> the reading loop. Compile tested only.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
>  drivers/net/wireless/marvell/mwifiex/sdio.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

We've already discussed and rejected this patch, if you aren't
planning on doing any real testing with it.

Subject: Re: [PATCH] wifi: mwifiex: fix SDIO firmware dump wait
https://lore.kernel.org/all/CA+ASDXNu-CWa9V5Oc-01pLp72iMVRw7m46+bDdNUxVmfrR9PSQ@mail.gmail.com/

It's *probably* correct, but it's risky without any cursory testing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-23 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20  9:46 [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling Dmitry Antipov
2023-10-20  9:46 ` [PATCH 2/2] wifi: mwifiex: remove unreachable code in mwifiex_sec_ioctl_set_wpa_key() Dmitry Antipov
2023-10-23 16:37 ` [PATCH 1/2] wifi: mwifiex: fix SDIO firmware read timeout handling Brian Norris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.