net/mlx5: fix crash on GRE flow rule parsing
net/mlx5: fix crash on GRE flow rule parsing

When set the GRE item, GRE key should follow after GRE header, or the
header gre_item pointer used by the key will be invalid.

Currently in the mlx5_flow_validate_item_gre_key() function, the header
gre_item pointer is access before checking if the key is after the
header or not. Once the key item is before the header, invalid gre_item
pointer access happens.

Move the gre_item pointer access after the GRE header check to avoid the
crash issue.

Fixes: a7a0365565a4 ("net/mlx5: match GRE key and present bits")
Cc: stable@dpdk.org

Signed-off-by: Suanming Mou <ffae22abfb44f67da81795938a64e892585787cc@mellanox.com>
Acked-by: Ori Kam <dd654df5de18ba542acfaea52fe1a0799392087d@mellanox.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk