Skip to content

Commit

Permalink
net/mlx5: E-Switch, Use the correct free() function
Browse files Browse the repository at this point in the history
We must use kvfree() for something that could have been allocated with vzalloc(),
do that.

Fixes: 5742df0 ('net/mlx5: E-Switch, Introduce VST vport ingress/egress ACLs')
Fixes: 86d722a ('net/mlx5: Use flow steering infrastructure for mlx5_en')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Or Gerlitz authored and David S. Miller committed Jun 10, 2016
1 parent bd02ef8 commit 3fe3d81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ static int esw_create_fdb_table(struct mlx5_eswitch *esw, int nvports)
}
}

kfree(flow_group_in);
kvfree(flow_group_in);
return err;
}

Expand Down Expand Up @@ -1097,7 +1097,7 @@ static void esw_vport_enable_egress_acl(struct mlx5_eswitch *esw,
vport->egress.drop_grp = drop_grp;
vport->egress.allowed_vlans_grp = vlan_grp;
out:
kfree(flow_group_in);
kvfree(flow_group_in);
if (err && !IS_ERR_OR_NULL(vlan_grp))
mlx5_destroy_flow_group(vlan_grp);
if (err && !IS_ERR_OR_NULL(acl))
Expand Down Expand Up @@ -1259,7 +1259,7 @@ static void esw_vport_enable_ingress_acl(struct mlx5_eswitch *esw,
mlx5_destroy_flow_table(vport->ingress.acl);
}

kfree(flow_group_in);
kvfree(flow_group_in);
}

static void esw_vport_cleanup_ingress_rules(struct mlx5_eswitch *esw,
Expand Down

0 comments on commit 3fe3d81

Please sign in to comment.