From d622c33e24bf6b84dc56fb6c55f624157ff95c36 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 16 Dec 2007 17:21:00 -0500 Subject: [PATCH] --- yaml --- r: 79238 b: refs/heads/master c: d1a469fd1b7335572a3803b6ba4ce3783a74532b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/libertas/assoc.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 3baa97217037..14fcf587ddcf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 681ffbb7d42435332fff0812145c7050d6153925 +refs/heads/master: d1a469fd1b7335572a3803b6ba4ce3783a74532b diff --git a/trunk/drivers/net/wireless/libertas/assoc.c b/trunk/drivers/net/wireless/libertas/assoc.c index cd8e043b16f4..882e51c16a75 100644 --- a/trunk/drivers/net/wireless/libertas/assoc.c +++ b/trunk/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",