aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ipw2200.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 27e87d1b9f44..e929f880dea0 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8837,7 +8837,6 @@ static int ipw_wx_set_essid(struct net_device *dev,
8837 union iwreq_data *wrqu, char *extra) 8837 union iwreq_data *wrqu, char *extra)
8838{ 8838{
8839 struct ipw_priv *priv = ieee80211_priv(dev); 8839 struct ipw_priv *priv = ieee80211_priv(dev);
8840 char *essid;
8841 int length; 8840 int length;
8842 8841
8843 mutex_lock(&priv->mutex); 8842 mutex_lock(&priv->mutex);
@@ -8852,12 +8851,14 @@ static int ipw_wx_set_essid(struct net_device *dev,
8852 return 0; 8851 return 0;
8853 } 8852 }
8854 8853
8855 length = min(wrqu->essid.length, IW_ESSID_MAX_SIZE); 8854 length = min((int)wrqu->essid.length, IW_ESSID_MAX_SIZE);
8856 essid = extra; 8855 if (!extra[length - 1])
8856 length--;
8857 8857
8858 priv->config |= CFG_STATIC_ESSID; 8858 priv->config |= CFG_STATIC_ESSID;
8859 8859
8860 if (priv->essid_len == length && !memcmp(priv->essid, extra, length)) { 8860 if (priv->essid_len == length && !memcmp(priv->essid, extra, length)
8861 && (priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) {
8861 IPW_DEBUG_WX("ESSID set to current ESSID.\n"); 8862 IPW_DEBUG_WX("ESSID set to current ESSID.\n");
8862 mutex_unlock(&priv->mutex); 8863 mutex_unlock(&priv->mutex);
8863 return 0; 8864 return 0;
@@ -8867,7 +8868,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
8867 length); 8868 length);
8868 8869
8869 priv->essid_len = length; 8870 priv->essid_len = length;
8870 memcpy(priv->essid, essid, priv->essid_len); 8871 memcpy(priv->essid, extra, priv->essid_len);
8871 8872
8872 /* Network configuration changed -- force [re]association */ 8873 /* Network configuration changed -- force [re]association */
8873 IPW_DEBUG_ASSOC("[re]association triggered due to ESSID change.\n"); 8874 IPW_DEBUG_ASSOC("[re]association triggered due to ESSID change.\n");