From: Jes Sorensen Date: Mon, 9 Jun 2014 13:16:42 +0000 (+0200) Subject: staging: rtl8723au: cfg80211_rtw_connect(): Simplify ssid preparation X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9cb08ff32c386cda497f83635817cd328478a308;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: cfg80211_rtw_connect(): Simplify ssid preparation Since we just matched sme->{ssid,ssid_len} to pnetwork->network.Ssid.{ssid,ssid_len} we can simplify the copy and move it to just before the call to rtw_set_ssid(). Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 281b48c590fe..0a6922d6a119 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -2188,10 +2188,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, sme->bssid)) { DBG_8723A("matched by bssid\n"); - memcpy(ssid.ssid, pnetwork->network.Ssid.ssid, - pnetwork->network.Ssid.ssid_len); - ssid.ssid_len = pnetwork->network.Ssid.ssid_len; - matched = true; break; } @@ -2201,9 +2197,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, pnetwork->network.Ssid.ssid_len == sme->ssid_len) { DBG_8723A("matched by ssid\n"); - memcpy(ssid.ssid, sme->ssid, sme->ssid_len); - ssid.ssid_len = sme->ssid_len; - matched = true; break; } @@ -2322,6 +2315,10 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, /* rtw_set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); */ + memcpy(ssid.ssid, pnetwork->network.Ssid.ssid, + pnetwork->network.Ssid.ssid_len); + ssid.ssid_len = pnetwork->network.Ssid.ssid_len; + if (rtw_set_ssid(padapter, &ssid) != _SUCCESS) { ret = -EBUSY; goto exit;