From: Rahul Lakkireddy Date: Fri, 14 Dec 2018 19:01:54 +0000 (+0530) Subject: net/cxgbe: skip parsing match items with no spec X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cadce5ee8aec5236d06474a94db0ba0ec6a48321;p=dpdk.git 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 --- 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)