Skip to content

Commit

Permalink
mlx4_en: nullify cached multicast address list after cleanup
Browse files Browse the repository at this point in the history
Solves an issue where we tried to free the same page twice after
the port has been opened and closed.

Signed-off-by: Alexander Guller <alexg@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Guller authored and David S. Miller committed Dec 19, 2011
1 parent 8d0fc7b commit 0e03567
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx4/en_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ static void mlx4_en_clear_list(struct net_device *dev)
struct mlx4_en_priv *priv = netdev_priv(dev);

kfree(priv->mc_addrs);
priv->mc_addrs = NULL;
priv->mc_addrs_cnt = 0;
}

Expand All @@ -170,6 +171,7 @@ static void mlx4_en_cache_mclist(struct net_device *dev)
i = 0;
netdev_for_each_mc_addr(ha, dev)
memcpy(mc_addrs + i++ * ETH_ALEN, ha->addr, ETH_ALEN);
mlx4_en_clear_list(dev);
priv->mc_addrs = mc_addrs;
priv->mc_addrs_cnt = mc_addrs_cnt;
}
Expand Down

0 comments on commit 0e03567

Please sign in to comment.