diff options
-rw-r--r-- | drivers/net/wireless/orinoco.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 95eb05abc44a..8de49fe57233 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -1053,8 +1053,9 @@ static void orinoco_join_ap(struct net_device *dev) | |||
1053 | u16 channel; | 1053 | u16 channel; |
1054 | } __attribute__ ((packed)) req; | 1054 | } __attribute__ ((packed)) req; |
1055 | const int atom_len = offsetof(struct prism2_scan_apinfo, atim); | 1055 | const int atom_len = offsetof(struct prism2_scan_apinfo, atim); |
1056 | struct prism2_scan_apinfo *atom; | 1056 | struct prism2_scan_apinfo *atom = NULL; |
1057 | int offset = 4; | 1057 | int offset = 4; |
1058 | int found = 0; | ||
1058 | u8 *buf; | 1059 | u8 *buf; |
1059 | u16 len; | 1060 | u16 len; |
1060 | 1061 | ||
@@ -1089,15 +1090,18 @@ static void orinoco_join_ap(struct net_device *dev) | |||
1089 | * we were requested to join */ | 1090 | * we were requested to join */ |
1090 | for (; offset + atom_len <= len; offset += atom_len) { | 1091 | for (; offset + atom_len <= len; offset += atom_len) { |
1091 | atom = (struct prism2_scan_apinfo *) (buf + offset); | 1092 | atom = (struct prism2_scan_apinfo *) (buf + offset); |
1092 | if (memcmp(&atom->bssid, priv->desired_bssid, ETH_ALEN) == 0) | 1093 | if (memcmp(&atom->bssid, priv->desired_bssid, ETH_ALEN) == 0) { |
1093 | goto found; | 1094 | found = 1; |
1095 | break; | ||
1096 | } | ||
1094 | } | 1097 | } |
1095 | 1098 | ||
1096 | DEBUG(1, "%s: Requested AP not found in scan results\n", | 1099 | if (! found) { |
1097 | dev->name); | 1100 | DEBUG(1, "%s: Requested AP not found in scan results\n", |
1098 | goto out; | 1101 | dev->name); |
1102 | goto out; | ||
1103 | } | ||
1099 | 1104 | ||
1100 | found: | ||
1101 | memcpy(req.bssid, priv->desired_bssid, ETH_ALEN); | 1105 | memcpy(req.bssid, priv->desired_bssid, ETH_ALEN); |
1102 | req.channel = atom->channel; /* both are little-endian */ | 1106 | req.channel = atom->channel; /* both are little-endian */ |
1103 | err = HERMES_WRITE_RECORD(hw, USER_BAP, HERMES_RID_CNFJOINREQUEST, | 1107 | err = HERMES_WRITE_RECORD(hw, USER_BAP, HERMES_RID_CNFJOINREQUEST, |