diff mbox

[3/3] cfg80211: slightly clean up of cfg80211_sme_connect()

Message ID 2765d477f16c3ade4361cbbbc170f7343b433b23.1395219362.git.gamerh2o@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gang ZHAO March 19, 2014, 9:04 a.m. UTC
Wdev->ssid has already been set in cfg80211_connect() and is equal to
connect->ssid, so the assignment here doesn't hurt. Use connect->ssid
instead of wdev->ssid so it will be consistent with following ssid_len
assignment statement.

If bss is found in cfg80211_get_conn_bss(), wdev->conn->state is set
to CFG80211_CONN_AUTHENTICATE_NEXT in there. So it's not needed to set
it manually to CFG80211_CONN_AUTHENTICATE_NEXT if bss is found in that
function.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
---
 net/wireless/sme.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Johannes Berg March 19, 2014, 2:26 p.m. UTC | #1
On Wed, 2014-03-19 at 17:04 +0800, Zhao, Gang wrote:

> -	wdev->conn->params.ssid = wdev->ssid;
> +	wdev->conn->params.ssid = connect->ssid;

I'm pretty sure this is wrong since one is a pointer and the other an
array.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index acdcb4a8..c259aa6 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -467,7 +467,7 @@  static int cfg80211_sme_connect(struct wireless_dev *wdev,
 		wdev->conn->auto_auth = false;
 	}
 
-	wdev->conn->params.ssid = wdev->ssid;
+	wdev->conn->params.ssid = connect->ssid;
 	wdev->conn->params.ssid_len = connect->ssid_len;
 
 	/* see if we have the bss already */
@@ -480,7 +480,6 @@  static int cfg80211_sme_connect(struct wireless_dev *wdev,
 
 	/* we're good if we have a matching bss struct */
 	if (bss) {
-		wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
 		err = cfg80211_conn_do_work(wdev);
 		cfg80211_put_bss(wdev->wiphy, bss);
 	} else {