From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> 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 <Jes.Sorensen@xxxxxxxxxx> --- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index c959adb..ea03d4f 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; -- 1.9.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel