From: Pekka Enberg Date: Wed, 16 Nov 2005 19:55:05 +0000 (+0200) Subject: [PATCH] ipw2200: disallow direct scanning when device is down X-Git-Tag: v2.6.15-rc2~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=efb3442cf1c65747a858476e10f705612383eed1;p=platform%2Fkernel%2Flinux-exynos.git [PATCH] ipw2200: disallow direct scanning when device is down The function ipw_request_direct_scan() should bail out when the device is down. This fixes a lockup caused by wpa_supplicant triggering ipw_request_direct_scan() while the driver was in a middle of a reset due to firmware errors. Thanks to Zilvinas Valinskas for reporting the bug and helping me debug it. Signed-off-by: Pekka Enberg Acked-by: Zhu Yi Signed-off-by: Linus Torvalds --- diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index b0d195d..374b682 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -8926,6 +8926,10 @@ static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid, struct ipw_scan_request_ext scan; int err = 0, scan_type; + if (!(priv->status & STATUS_INIT) || + (priv->status & STATUS_EXIT_PENDING)) + return 0; + down(&priv->sem); if (priv->status & STATUS_RF_KILL_MASK) {