Skip to content

Commit

Permalink
bnx2x: free the mac filter group list before freeing the cmd
Browse files Browse the repository at this point in the history
The group list must be freed prior to freeing the command otherwise
we have a use-after-free.

Signed-off-by: Jason Baron <[email protected]>
Cc: Yuval Mintz <[email protected]>
Cc: Ariel Elior <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
almostivan authored and davem330 committed Sep 27, 2016
1 parent 44675a6 commit e96e0ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e96e0ed

Please sign in to comment.