From: Xiaolong Ye Date: Mon, 5 Aug 2019 09:15:11 +0000 (+0800) Subject: net/ice: fix null pointer dereferences for tunnels X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4782c785f80154ec43dfb82d650ea30ce71ec639;p=dpdk.git net/ice: fix null pointer dereferences for tunnels This patch fixes two null pointer dereferences in flow code detected by coverity scan. Coverity issue: 345815, 345816 Fixes: 94f00800d78b ("net/ice: fix VXLAN/NVGRE flow matching") Signed-off-by: Xiaolong Ye Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 5fcf4289cf..1c0adc7791 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -464,7 +464,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], "Invalid VXLAN item"); return 0; } - if (vxlan_mask->vni[0] == UINT8_MAX && + if (vxlan_mask && vxlan_mask->vni[0] == UINT8_MAX && vxlan_mask->vni[1] == UINT8_MAX && vxlan_mask->vni[2] == UINT8_MAX) input_set |= ICE_INSET_TUN_ID; @@ -486,7 +486,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], "Invalid NVGRE item"); return 0; } - if (nvgre_mask->tni[0] == UINT8_MAX && + if (nvgre_mask && nvgre_mask->tni[0] == UINT8_MAX && nvgre_mask->tni[1] == UINT8_MAX && nvgre_mask->tni[2] == UINT8_MAX) input_set |= ICE_INSET_TUN_ID;