From fbbc07f4977de7a8d51d7f4b48c63127157d1942 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 1 Sep 2005 20:06:06 -0400 Subject: [PATCH] --- yaml --- r: 7285 b: refs/heads/master c: c89cc225f72ec240196733872fa1a9eb9d8335ac h: refs/heads/master i: 7283: bd32f0e5e17e8d04d67b8a5d076a666581951d1a v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/orinoco.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index b2a22b89c8ff..9f118ddbd43c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 708218b064e3ad3d55ac0f9d19b3c8c0fb7af3a4 +refs/heads/master: c89cc225f72ec240196733872fa1a9eb9d8335ac diff --git a/trunk/drivers/net/wireless/orinoco.c b/trunk/drivers/net/wireless/orinoco.c index 95eb05abc44a..8de49fe57233 100644 --- a/trunk/drivers/net/wireless/orinoco.c +++ b/trunk/drivers/net/wireless/orinoco.c @@ -1053,8 +1053,9 @@ static void orinoco_join_ap(struct net_device *dev) u16 channel; } __attribute__ ((packed)) req; const int atom_len = offsetof(struct prism2_scan_apinfo, atim); - struct prism2_scan_apinfo *atom; + struct prism2_scan_apinfo *atom = NULL; int offset = 4; + int found = 0; u8 *buf; u16 len; @@ -1089,15 +1090,18 @@ static void orinoco_join_ap(struct net_device *dev) * we were requested to join */ for (; offset + atom_len <= len; offset += atom_len) { atom = (struct prism2_scan_apinfo *) (buf + offset); - if (memcmp(&atom->bssid, priv->desired_bssid, ETH_ALEN) == 0) - goto found; + if (memcmp(&atom->bssid, priv->desired_bssid, ETH_ALEN) == 0) { + found = 1; + break; + } } - DEBUG(1, "%s: Requested AP not found in scan results\n", - dev->name); - goto out; + if (! found) { + DEBUG(1, "%s: Requested AP not found in scan results\n", + dev->name); + goto out; + } - found: memcpy(req.bssid, priv->desired_bssid, ETH_ALEN); req.channel = atom->channel; /* both are little-endian */ err = HERMES_WRITE_RECORD(hw, USER_BAP, HERMES_RID_CNFJOINREQUEST,