Commit bdd4d6bf authored by Avinash Patil's avatar Avinash Patil Committed by John W. Linville

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: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4c1079e1
...@@ -107,18 +107,15 @@ mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies, ...@@ -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) 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; unsigned long flags;
spin_lock_irqsave(&priv->sta_list_spinlock, flags); spin_lock_irqsave(&priv->sta_list_spinlock, flags);
node = mwifiex_get_sta_entry(priv, mac); node = mwifiex_get_sta_entry(priv, mac);
if (node) { if (node) {
list_for_each_entry_safe(node, tmp, &priv->sta_list, list_del(&node->list);
list) { kfree(node);
list_del(&node->list);
kfree(node);
}
} }
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
......
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