diff options
author | jbaron@akamai.com <jbaron@akamai.com> | 2016-09-26 18:00:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-27 16:55:18 +0300 |
commit | e96e0eded1335b9cfac71fcdd989d682eb3f8412 (patch) | |
tree | c220652dd78b24042eb510f6736d6ca05e4ffdec /drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | |
parent | 44675a6df839259102178c1e0c3c082821fcb8b7 (diff) | |
download | linux-e96e0eded1335b9cfac71fcdd989d682eb3f8412.tar.xz |
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>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c')
-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, elem_group = (struct bnx2x_mcast_elem_group *) __get_free_page(GFP_ATOMIC | __GFP_ZERO); if (!elem_group) { - kfree(new_cmd); bnx2x_free_groups(&new_cmd->group_head); + kfree(new_cmd); return -ENOMEM; } total_elems -= MCAST_MAC_ELEMS_PER_PG; |