From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 1D5C01B9D3; Fri, 14 Dec 2018 20:03:38 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id wBEJ3ZKU016129; Fri, 14 Dec 2018 11:03:35 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Cc: nirranjan@chelsio.com, indranil@chelsio.com, stable@dpdk.org Date: Sat, 15 Dec 2018 00:31:54 +0530 Message-Id: <361cf24699f7976d5b03fa5833ce19db7237bfd3.1544813681.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 2/2] net/cxgbe: skip parsing match items with no spec X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2018 19:03:39 -0000 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 4deaff8f2..7b87bdf58 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.18.0