[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191002174103.1274-1-efremov@linux.com>
Date: Wed, 2 Oct 2019 20:41:03 +0300
From: Denis Efremov <efremov@...ux.com>
To: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Cc: Denis Efremov <efremov@...ux.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org
Subject: [PATCH] staging: wlan-ng: fix uninitialized variable
The result variable in prism2_connect() can be used uninitialized on path
!channel --> ... --> is_wep --> sme->key --> sme->key_idx >= NUM_WEPKEYS.
This patch initializes result with 0.
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: stable@...r.kernel.org
Signed-off-by: Denis Efremov <efremov@...ux.com>
---
drivers/staging/wlan-ng/cfg80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index eee1998c4b18..d426905e187e 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -441,7 +441,7 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev,
int chan = -1;
int is_wep = (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40) ||
(sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104);
- int result;
+ int result = 0;
int err = 0;
/* Set the channel */
--
2.21.0
Powered by blists - more mailing lists