mwifiex: fix corner case system hang issue
authorAmitkumar Karwar <akarwar@marvell.com>
Sat, 12 Jul 2014 03:53:14 +0000 (20:53 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 15 Jul 2014 20:00:05 +0000 (16:00 -0400)
commitd5343f06902bf6635734d1e72aa2100dd63a6f4b
tree8ae5cc9912724c112e35da7ddf652432c564ce68
parent2d702830e004f17e62980869e72f79775140201a
mwifiex: fix corner case system hang issue

Sometimes pending internal scan commands are delayed to give
preference to Tx traffic. 'scan_processing' flag has been
checked at the beginning of delay timer routine to know if in the
meantime scan operation has been cancelled.

There is a corner case where pending scan commands are emptied
after scan_processing flag check is passed. In this case
wrong pointer returned by list_first_entry() is passed to
list_del() which causes system hang.

This patch fixes the issue by adding list_empty() check.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/main.c