net/mlx5: Fix NULL pointer dereference in extended destination

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: 2b688ea5ef ("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>
This commit is contained in:
Eli Britstein 2019-10-15 12:44:18 +00:00 committed by Saeed Mahameed
parent 2347cee83b
commit 0fd79b1e17

View File

@ -507,7 +507,8 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
MLX5_SET(dest_format_struct, in_dests, MLX5_SET(dest_format_struct, in_dests,
destination_eswitch_owner_vhca_id, destination_eswitch_owner_vhca_id,
dst->dest_attr.vport.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, MLX5_SET(dest_format_struct, in_dests,
packet_reformat, packet_reformat,
!!(dst->dest_attr.vport.flags & !!(dst->dest_attr.vport.flags &