]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Fix NULL pointer dereference in extended destination
authorEli Britstein <elibr@mellanox.com>
Tue, 15 Oct 2019 12:44:18 +0000 (12:44 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 29 Oct 2019 23:27:19 +0000 (16:27 -0700)
The cited commit refactored the encap id into a struct pointed from the
destination.
Bug fix for the case there is no encap for one of the destinations.

Fixes: efc7d8667484 ("net/mlx5: Add flow steering actions to fs_cmd shim layer")
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c

index 579c306caa7b10345c5a0f9ae7c9892d489f1de9..3c816e81f8d9bab405cbeeb3901d40341cbdd60d 100644 (file)
@@ -507,7 +507,8 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
                                MLX5_SET(dest_format_struct, in_dests,
                                         destination_eswitch_owner_vhca_id,
                                         dst->dest_attr.vport.vhca_id);
-                               if (extended_dest) {
+                               if (extended_dest &&
+                                   dst->dest_attr.vport.pkt_reformat) {
                                        MLX5_SET(dest_format_struct, in_dests,
                                                 packet_reformat,
                                                 !!(dst->dest_attr.vport.flags &