net/mlx5: fix VLAN flow action with wildcard VLAN item
[dpdk.git] / drivers / net / mlx5 / mlx5_flow_dv.c
index fd002f3..71da5fb 100644 (file)
@@ -1881,6 +1881,9 @@ flow_dev_get_vlan_info_from_items(const struct rte_flow_item *items,
                const struct rte_flow_item_vlan *vlan_m = items->mask;
                const struct rte_flow_item_vlan *vlan_v = items->spec;
 
+               /* If VLAN item in pattern doesn't contain data, return here. */
+               if (!vlan_v)
+                       return;
                if (!vlan_m)
                        vlan_m = &nic_mask;
                /* Only full match values are accepted */