Search Linux Wireless

[PATCH 2/2] mwifiex: fix list_del corruption while unloading modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Amitkumar Karwar <akarwar@xxxxxxxxxxx>

Driver uses pre-allocated number of command buffers. The
command free queue keeps track of command buffers currently
free/available for use.
Currently while unloading the driver, command free queue is
freed after releasing pre-allocated command buffers which
sometimes leads to list_del corruption issue.
Therefore command free queue is freed before releasing
command buffers to fix the issue.

Signed-off-by: Amitkumar Karwar <akarwar@xxxxxxxxxxx>
Signed-off-by: Bing Zhao <bzhao@xxxxxxxxxxx>
---
 drivers/net/wireless/mwifiex/init.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index de670c7..91a484c 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -353,6 +353,10 @@ mwifiex_free_adapter(struct mwifiex_adapter *adapter)
 	}
 
 	mwifiex_cancel_all_pending_cmd(adapter);
+
+	/* Free lock variables */
+	mwifiex_free_lock_list(adapter);
+
 	/* Free command buffer */
 	PRINTM(MINFO, "Free Command buffer\n");
 	mwifiex_free_cmd_buffer(adapter);
@@ -367,9 +371,6 @@ mwifiex_free_adapter(struct mwifiex_adapter *adapter)
 
 	mwifiex_free_buffer(adapter->sleep_cfm);
 
-	/* Free lock variables */
-	mwifiex_free_lock_list(adapter);
-
 	LEAVE();
 	return;
 }
-- 
1.7.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux