summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-10 20:34:07 +0000
committerDavid S. Miller <davem@davemloft.net>2012-07-16 22:58:07 -0700
commit9c64508af2c171f57a198729c59a7a6f6998b3a1 (patch)
treeecd55407d2b2d16798a4b717eec0f76842319c08
parent447458c01f4c765ab37ac7b380e60d977daae4c5 (diff)
downloadlinux-9c64508af2c171f57a198729c59a7a6f6998b3a1.tar.bz2
net/mlx4_en: dereferencing freed memory
We dereferenced "mclist" after the kfree(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 94375a8c6d42..4ce5ca81a010 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -503,9 +503,7 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
/* remove from list */
list_del(&mclist->list);
kfree(mclist);
- }
-
- if (mclist->action == MCLIST_ADD) {
+ } else if (mclist->action == MCLIST_ADD) {
/* attach the address */
memcpy(&mc_list[10], mclist->addr, ETH_ALEN);
/* needed for B0 steering support */