From cadce5ee8aec5236d06474a94db0ba0ec6a48321 Mon Sep 17 00:00:00 2001 From: Rahul Lakkireddy Date: Sat, 15 Dec 2018 00:31:54 +0530 Subject: [PATCH] net/cxgbe: skip parsing match items with no spec Skip parsing pattern match items that have no spec. This fixes NULL dereference when accessing their non-existent spec. Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_flow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c index 4deaff8f2f..7b87bdf583 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -732,6 +732,10 @@ cxgbe_rtef_parse_items(struct rte_flow *flow, "parse items cannot be repeated (except void)"); repeat[i->type] = 1; + /* No spec found for this pattern item. Skip it */ + if (!i->spec) + break; + /* validate the item */ ret = cxgbe_validate_item(i, e); if (ret) -- 2.20.1