X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fnet%2Fwireless%2Forinoco.c;h=6d13a0d15a0cba9818b21852e89da8dc0a0c22cf;hb=6af74b03e00fc78806f75f6701b24b582bbb5c96;hp=100ae333df4d3eb6868012544014a0f7516ac009;hpb=1e3428e9e327a6e4163b3674b260dbd719f59839;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 100ae333df4..6d13a0d15a0 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c @@ -1194,7 +1194,7 @@ static int orinoco_process_scan_results(struct net_device *dev, /* Read the entries one by one */ for (; offset + atom_len <= len; offset += atom_len) { int found = 0; - bss_element *bss; + bss_element *bss = NULL; /* Get next atom */ atom = (union hermes_scan_info *) (buf + offset); @@ -1209,7 +1209,6 @@ static int orinoco_process_scan_results(struct net_device *dev, if (memcmp(bss->bss.a.essid, atom->a.essid, le16_to_cpu(atom->a.essid_len))) continue; - bss->last_scanned = jiffies; found = 1; break; } @@ -1220,10 +1219,14 @@ static int orinoco_process_scan_results(struct net_device *dev, bss_element, list); list_del(priv->bss_free_list.next); - memcpy(bss, atom, sizeof(bss->bss)); - bss->last_scanned = jiffies; list_add_tail(&bss->list, &priv->bss_list); } + + if (bss) { + /* Always update the BSS to get latest beacon info */ + memcpy(&bss->bss, atom, sizeof(bss->bss)); + bss->last_scanned = jiffies; + } } return 0;