aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-16 17:21:00 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:39 -0500
commitd1a469fd1b7335572a3803b6ba4ce3783a74532b (patch)
treeefc55a2f2845c54a3d6895b4bc7f0a1826154003 /drivers/net/wireless/libertas
parent681ffbb7d42435332fff0812145c7050d6153925 (diff)
libertas: fix return from lbs_update_channel()
If we return the channel number in a 'ret' variable where anything non-zero is later interpreted as an error, that isn't nice. It breaks WPA, for a start. OLPC trac #5485 Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/assoc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index cd8e043b16f4..882e51c16a75 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -167,13 +167,14 @@ int lbs_update_channel(struct lbs_private *priv)
167{ 167{
168 int ret; 168 int ret;
169 169
170 /* the channel in f/w could be out of sync, get the current channel */ 170 /* the channel in f/w could be out of sync; get the current channel */
171 lbs_deb_enter(LBS_DEB_ASSOC); 171 lbs_deb_enter(LBS_DEB_ASSOC);
172 172
173 ret = lbs_get_channel(priv); 173 ret = lbs_get_channel(priv);
174 if (ret > 0) 174 if (ret > 0) {
175 priv->curbssparams.channel = (u8) ret; 175 priv->curbssparams.channel = ret;
176 176 ret = 0;
177 }
177 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); 178 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
178 return ret; 179 return ret;
179} 180}
@@ -197,8 +198,9 @@ static int assoc_helper_channel(struct lbs_private *priv,
197 lbs_deb_enter(LBS_DEB_ASSOC); 198 lbs_deb_enter(LBS_DEB_ASSOC);
198 199
199 ret = lbs_update_channel(priv); 200 ret = lbs_update_channel(priv);
200 if (ret < 0) { 201 if (ret) {
201 lbs_deb_assoc("ASSOC: channel: error getting channel.\n"); 202 lbs_deb_assoc("ASSOC: channel: error getting channel.\n");
203 goto done;
202 } 204 }
203 205
204 if (assoc_req->channel == priv->curbssparams.channel) 206 if (assoc_req->channel == priv->curbssparams.channel)
@@ -222,8 +224,10 @@ static int assoc_helper_channel(struct lbs_private *priv,
222 * it since the firmware is supposed to return the new channel, but 224 * it since the firmware is supposed to return the new channel, but
223 * whatever... */ 225 * whatever... */
224 ret = lbs_update_channel(priv); 226 ret = lbs_update_channel(priv);
225 if (ret < 0) 227 if (ret) {
226 lbs_deb_assoc("ASSOC: channel: error getting channel.\n"); 228 lbs_deb_assoc("ASSOC: channel: error getting channel.\n");
229 goto done;
230 }
227 231
228 if (assoc_req->channel != priv->curbssparams.channel) { 232 if (assoc_req->channel != priv->curbssparams.channel) {
229 lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n", 233 lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n",