mwifiex: fix incomplete scan in case of IE parsing error
authorBing Zhao <bzhao@marvell.com>
Tue, 29 Jan 2013 22:38:02 +0000 (14:38 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Feb 2013 18:48:00 +0000 (10:48 -0800)
commitff888473a24be9e8761e6baabbc73386b5f747b9
tree1b4464b7e43879a0273237103d9276efcbdf8b97
parent10755f7e244ef8ed49d278db4aafd50d9f15fd4c
mwifiex: fix incomplete scan in case of IE parsing error

commit 8a7d7cbf7b5ff9912ef50b3e94c9ad9f37b1c75f upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mwifiex/scan.c