diff options
author | jbaron@akamai.com <jbaron@akamai.com> | 2016-09-26 11:00:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-27 09:55:18 -0400 |
commit | e96e0eded1335b9cfac71fcdd989d682eb3f8412 (patch) | |
tree | c220652dd78b24042eb510f6736d6ca05e4ffdec | |
parent | 44675a6df839259102178c1e0c3c082821fcb8b7 (diff) |
bnx2x: free the mac filter group list before freeing the cmd
The group list must be freed prior to freeing the command otherwise
we have a use-after-free.
Signed-off-by: Jason Baron <jbaron@akamai.com>
Cc: Yuval Mintz <Yuval.Mintz@qlogic.com>
Cc: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 4947a9cbf0c1..cea6bdcde33f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | |||
@@ -2714,8 +2714,8 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp, | |||
2714 | elem_group = (struct bnx2x_mcast_elem_group *) | 2714 | elem_group = (struct bnx2x_mcast_elem_group *) |
2715 | __get_free_page(GFP_ATOMIC | __GFP_ZERO); | 2715 | __get_free_page(GFP_ATOMIC | __GFP_ZERO); |
2716 | if (!elem_group) { | 2716 | if (!elem_group) { |
2717 | kfree(new_cmd); | ||
2718 | bnx2x_free_groups(&new_cmd->group_head); | 2717 | bnx2x_free_groups(&new_cmd->group_head); |
2718 | kfree(new_cmd); | ||
2719 | return -ENOMEM; | 2719 | return -ENOMEM; |
2720 | } | 2720 | } |
2721 | total_elems -= MCAST_MAC_ELEMS_PER_PG; | 2721 | total_elems -= MCAST_MAC_ELEMS_PER_PG; |