Commit 5e6588b9 authored by Brian Norris's avatar Brian Norris Committed by Kalle Valo

mwifiex: fix misnomers in mwifiex_free_lock_list()

Despite the name (and meticulous comments), this function frees no
memory and does not touch any locks. All it does is "delete" the list
heads -- which just means they'll be dangling, and we'll need to re-init
them if we use them again.

It seems like this code would work OK as a sort of canary for using the
list after we've torn everything down, so it's fine to keep the code;
let's just get the name and comments to match what's actually happening.
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9557d9f2
...@@ -373,15 +373,13 @@ void mwifiex_stop_net_dev_queue(struct net_device *netdev, ...@@ -373,15 +373,13 @@ void mwifiex_stop_net_dev_queue(struct net_device *netdev,
} }
/* /*
* This function releases the lock variables and frees the locks and * This function invalidates the list heads.
* associated locks.
*/ */
static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) static void mwifiex_invalidate_lists(struct mwifiex_adapter *adapter)
{ {
struct mwifiex_private *priv; struct mwifiex_private *priv;
s32 i, j; s32 i, j;
/* Free lists */
list_del(&adapter->cmd_free_q); list_del(&adapter->cmd_free_q);
list_del(&adapter->cmd_pending_q); list_del(&adapter->cmd_pending_q);
list_del(&adapter->scan_pending_q); list_del(&adapter->scan_pending_q);
...@@ -422,8 +420,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter) ...@@ -422,8 +420,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter)
void mwifiex_free_cmd_buffers(struct mwifiex_adapter *adapter) void mwifiex_free_cmd_buffers(struct mwifiex_adapter *adapter)
{ {
/* Free lock variables */ mwifiex_invalidate_lists(adapter);
mwifiex_free_lock_list(adapter);
/* Free command buffer */ /* Free command buffer */
mwifiex_dbg(adapter, INFO, "info: free cmd buffer\n"); mwifiex_dbg(adapter, INFO, "info: free cmd buffer\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment