Skip to content

Commit e96e0ed

Browse files
almostivandavem330
authored andcommitted
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 <[email protected]> Cc: Yuval Mintz <[email protected]> Cc: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 44675a6 commit e96e0ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2714,8 +2714,8 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
27142714
elem_group = (struct bnx2x_mcast_elem_group *)
27152715
__get_free_page(GFP_ATOMIC | __GFP_ZERO);
27162716
if (!elem_group) {
2717-
kfree(new_cmd);
27182717
bnx2x_free_groups(&new_cmd->group_head);
2718+
kfree(new_cmd);
27192719
return -ENOMEM;
27202720
}
27212721
total_elems -= MCAST_MAC_ELEMS_PER_PG;

0 commit comments

Comments
 (0)