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; } 
static void orinoco_join_ap(struct net_device *dev){	struct orinoco_private *priv = netdev_priv(dev);	struct hermes *hw = &priv->hw;	int err;	unsigned long flags;	struct join_req {		u8 bssid[ETH_ALEN];		u16 channel;	} __attribute__ ((packed)) req;	const int atom_len = offsetof(struct prism2_scan_apinfo, atim);	struct prism2_scan_apinfo *atom;	int offset = 4;	u8 *buf;	u16 len;	/* Allocate buffer for scan results */	buf = kmalloc(MAX_SCAN_LEN, GFP_KERNEL);	if (! buf)		return;	if (orinoco_lock(priv, &flags) != 0)		goto out;	/* Sanity checks in case user changed something in the meantime */	if (! priv->bssid_fixed)		goto out;	if (strlen(priv->desired_essid) == 0)		goto out;	/* Read scan results from the firmware */	err = hermes_read_ltv(hw, USER_BAP,			      HERMES_RID_SCANRESULTSTABLE,			      MAX_SCAN_LEN, &len, buf);	if (err) {		printk(KERN_ERR "%s: Cannot read scan results\n",		       dev->name);		goto out;	}	len = HERMES_RECLEN_TO_BYTES(len);	/* Go through the scan results looking for the channel of the AP	 * 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;	}	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,				  &req);	if (err)		printk(KERN_ERR "%s: Error issuing join request\n", dev->name); out:	kfree(buf);	orinoco_unlock(priv, &flags);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c89cc225f72ec240196733872fa1a9eb9d8335ac/orinoco.c/buggy/drivers/net/wireless/orinoco.c