From: Dan Carpenter Date: Tue, 10 Jul 2012 20:34:07 +0000 (+0000) Subject: net/mlx4_en: dereferencing freed memory X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9c64508af2c171f57a198729c59a7a6f6998b3a1;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git net/mlx4_en: dereferencing freed memory We dereferenced "mclist" after the kfree(). Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- 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 */