summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOz Shlomo <ozsh@nvidia.com>2022-12-04 01:13:23 +0300
committerJakub Kicinski <kuba@kernel.org>2022-12-09 00:04:26 +0300
commit5a5624d1edf44e808481dedaf59eae61fd66e052 (patch)
tree2c6623030d93e141ba4423b690903511ad6902a0
parentbde55dd9ccda7a3f5f735d89e855691362745248 (diff)
downloadlinux-5a5624d1edf44e808481dedaf59eae61fd66e052.tar.xz
net/mlx5e: E-Switch, handle flow attribute with no destinations
Rules with drop action are not required to have a destination. Currently the destination list is allocated with the maximum number of destinations and passed to the fs_core layer along with the actual number of destinations. Remove redundant passing of dest pointer when count of dest is 0. Signed-off-by: Oz Shlomo <ozsh@nvidia.com> Reviewed-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Link: https://lore.kernel.org/r/20221203221337.29267-2-saeed@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index c6a14202c62c..1987a9d9d40c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -640,6 +640,11 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
goto err_esw_get;
}
+ if (!i) {
+ kfree(dest);
+ dest = NULL;
+ }
+
if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec))
rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, esw_attr,
&flow_act, dest, i);