UPSTREAM: mwifiex: fix incomplete scan in case of IE parsing error
authorBing Zhao <bzhao@marvell.com>
Thu, 31 Jan 2013 05:12:16 +0000 (21:12 -0800)
committerChromeBot <chrome-bot@google.com>
Thu, 31 Jan 2013 17:38:29 +0000 (09:38 -0800)
commit1e7196f815c542e09738b7d79ef1eed753c5d4b7
tree9820f50a1c028d257b6ef89fc0490817021084db
parentaf42f642ce668ae967bb6e5fa2d7526bdba13a8a
UPSTREAM: mwifiex: fix incomplete scan in case of IE parsing error

A scan request is split into multiple scan commands queued in
scan_pending_q. Each scan command will be sent to firmware and
its response is handlded one after another.

If any error is detected while parsing IE in command response
buffer the remaining data will be ignored and error is returned.

We should check if there is any more scan commands pending in
the queue before returning error. This ensures that we will call
cfg80211_scan_done if this is the last scan command, or send
next scan command in scan_pending_q to firmware.

Cc: "3.6+" <stable@vger.kernel.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
BUG=none
TEST=Hacked the driver to simulate an IE parsing error.
Without this patch, "iw mlan0 scan" gets stuck.
With this patch applied, "iw mlan0 scan" returns AP list.

Change-Id: I93cb877650ad9e84e5109f4ea62cf5b5c638e26a
Reviewed-on: https://gerrit.chromium.org/gerrit/42377
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Bing Zhao <bzhao@marvell.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
drivers/net/wireless/mwifiex/scan.c