{
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;
}
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)
* 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",