diff mbox series

wifi: orinoco: check return value of hermes_write_wordrec()

Message ID 20221227133306.201356-1-aleksei.kodanev@bell-sw.com
State New
Headers show
Series wifi: orinoco: check return value of hermes_write_wordrec() | expand

Commit Message

Alexey Kodanev Dec. 27, 2022, 1:33 p.m. UTC
There is currently no return check for writing an authentication
type (HERMES_AUTH_SHARED_KEY or HERMES_AUTH_OPEN). It looks like
it was accidentally skipped.

This patch adds a return check similar to the other checks in
__orinoco_hw_setup_enc() for hermes_write_wordrec().

Detected using the static analysis tool - Svace.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
---
 drivers/net/wireless/intersil/orinoco/hw.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kalle Valo Jan. 16, 2023, 4:22 p.m. UTC | #1
Alexey Kodanev <aleksei.kodanev@bell-sw.com> wrote:

> There is currently no return check for writing an authentication
> type (HERMES_AUTH_SHARED_KEY or HERMES_AUTH_OPEN). It looks like
> it was accidentally skipped.
> 
> This patch adds a return check similar to the other checks in
> __orinoco_hw_setup_enc() for hermes_write_wordrec().
> 
> Detected using the static analysis tool - Svace.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>

Patch applied to wireless-next.git, thanks.

1e346cbb096a wifi: orinoco: check return value of hermes_write_wordrec()
diff mbox series

Patch

diff --git a/drivers/net/wireless/intersil/orinoco/hw.c b/drivers/net/wireless/intersil/orinoco/hw.c
index 0aea35c9c11c..4fcca08e50de 100644
--- a/drivers/net/wireless/intersil/orinoco/hw.c
+++ b/drivers/net/wireless/intersil/orinoco/hw.c
@@ -931,6 +931,8 @@  int __orinoco_hw_setup_enc(struct orinoco_private *priv)
 			err = hermes_write_wordrec(hw, USER_BAP,
 					HERMES_RID_CNFAUTHENTICATION_AGERE,
 					auth_flag);
+			if (err)
+				return err;
 		}
 		err = hermes_write_wordrec(hw, USER_BAP,
 					   HERMES_RID_CNFWEPENABLED_AGERE,