From bdd4d6bf59c046e5a3d1ac67ba7b1c9ea540b6e3 Mon Sep 17 00:00:00 2001 From: Avinash Patil Date: Fri, 17 May 2013 17:50:22 -0700 Subject: [PATCH] mwifiex: avoid deleting all stations during mwifiex_del_sta_entry() During deleting a station entry from associated sta_list, we are supposed to delete entry only for this particular mac address. This patch is a bug fix wherein we were deleting all entries from list; fix this by removing list_for_each_entry_safe() call. Signed-off-by: Avinash Patil Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- drivers/net/wireless/mwifiex/uap_event.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mwifiex/uap_event.c b/drivers/net/wireless/mwifiex/uap_event.c index 21c640d3b579..77fb533ae10a 100644 --- a/drivers/net/wireless/mwifiex/uap_event.c +++ b/drivers/net/wireless/mwifiex/uap_event.c @@ -107,18 +107,15 @@ mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies, */ static void mwifiex_del_sta_entry(struct mwifiex_private *priv, u8 *mac) { - struct mwifiex_sta_node *node, *tmp; + struct mwifiex_sta_node *node; unsigned long flags; spin_lock_irqsave(&priv->sta_list_spinlock, flags); node = mwifiex_get_sta_entry(priv, mac); if (node) { - list_for_each_entry_safe(node, tmp, &priv->sta_list, - list) { - list_del(&node->list); - kfree(node); - } + list_del(&node->list); + kfree(node); } spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); -- 2.39.5