mwifiex: avoid deleting all stations during mwifiex_del_sta_entry()
authorAvinash Patil <patila@marvell.com>
Sat, 18 May 2013 00:50:22 +0000 (17:50 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 May 2013 19:08:53 +0000 (15:08 -0400)
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 <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/uap_event.c

index 21c640d3b57919792e53406ed94ae7cca96a90e7..77fb533ae10a12498b39ac11fb73cff6faf86f15 100644 (file)
@@ -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);