Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1a469fd1b7335572a3803b6ba4ce3783a74532b
Commit:     d1a469fd1b7335572a3803b6ba4ce3783a74532b
Parent:     681ffbb7d42435332fff0812145c7050d6153925
Author:     David Woodhouse <[EMAIL PROTECTED]>
AuthorDate: Sun Dec 16 17:21:00 2007 -0500
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:07:39 2008 -0800

    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 <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/assoc.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/libertas/assoc.c 
b/drivers/net/wireless/libertas/assoc.c
index cd8e043..882e51c 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)
 {
        int ret;
 
-       /* the channel in f/w could be out of sync, get the current channel */
+       /* the channel in f/w could be out of sync; get the current channel */
        lbs_deb_enter(LBS_DEB_ASSOC);
 
        ret = lbs_get_channel(priv);
-       if (ret > 0)
-               priv->curbssparams.channel = (u8) ret;
-
+       if (ret > 0) {
+               priv->curbssparams.channel = ret;
+               ret = 0;
+       }
        lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
        return ret;
 }
@@ -197,8 +198,9 @@ static int assoc_helper_channel(struct lbs_private *priv,
        lbs_deb_enter(LBS_DEB_ASSOC);
 
        ret = lbs_update_channel(priv);
-       if (ret < 0) {
+       if (ret) {
                lbs_deb_assoc("ASSOC: channel: error getting channel.\n");
+               goto done;
        }
 
        if (assoc_req->channel == priv->curbssparams.channel)
@@ -222,8 +224,10 @@ static int assoc_helper_channel(struct lbs_private *priv,
         * it since the firmware is supposed to return the new channel, but
         * whatever... */
        ret = lbs_update_channel(priv);
-       if (ret < 0)
+       if (ret) {
                lbs_deb_assoc("ASSOC: channel: error getting channel.\n");
+               goto done;
+       }
 
        if (assoc_req->channel != priv->curbssparams.channel) {
                lbs_deb_assoc("ASSOC: channel: failed to update channel to 
%d\n",
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to