From: Dan Williams Date: Fri, 30 Jul 2010 06:11:30 +0000 (-0700) Subject: libertas: get the right # of scanned BSSes X-Git-Tag: MMI-PSA29.97-13-9~22097^2~231^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aebb628f39ccf67fe9ed888c7f80926fc1070ce5;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git libertas: get the right # of scanned BSSes Let's actually check the right field in the command response; and if there aren't any reported BSSes, exit early with success. Signed-off-by: Dan Williams Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 25f902760980..b60f66115061 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c @@ -465,7 +465,15 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, lbs_deb_enter(LBS_DEB_CFG80211); bsssize = get_unaligned_le16(&scanresp->bssdescriptsize); - nr_sets = le16_to_cpu(resp->size); + nr_sets = le16_to_cpu(scanresp->nr_sets); + + lbs_deb_scan("scan response: %d BSSs (%d bytes); resp size %d bytes\n", + nr_sets, bsssize, le16_to_cpu(resp->size)); + + if (nr_sets == 0) { + ret = 0; + goto done; + } /* * The general layout of the scan response is described in chapter