From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 718E1A2E1B for ; Tue, 3 Sep 2019 04:20:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 511851EB2D; Tue, 3 Sep 2019 04:19:32 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 57B0D1E980 for ; Tue, 3 Sep 2019 04:19:09 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 1C01830C1FF; Mon, 2 Sep 2019 19:19:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 1C01830C1FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1567477142; bh=UWW8Hc6/Jl4LdNRa1GR6NkagXQJ8bnxdTHwuihKsDOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W/EMohOxlza2vg3x1P22RUgcnlMcOGhFZIM9aFOB2EdL/ALl8x39WhezmcMHEsX/A 7jWRs5ClCZzeC78O1HtsMWi0DHg00RiO8ylw67e3qAmwTvX9LHya4XkV3+DCaDZOcd k0au4Z1txvjZyz02JbGYfCe6nE8be4zyLqpU7NNI= Received: from localhost.localdomain (unknown [10.230.30.225]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 1AFBEAC06AB; Mon, 2 Sep 2019 19:19:08 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Stephen Hemminger , Somnath Kotur , Venkat Duvvuru Date: Mon, 2 Sep 2019 19:18:55 -0700 Message-Id: <20190903021901.25895-12-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190903021901.25895-1-ajit.khaparde@broadcom.com> References: <20190903021901.25895-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 11/17] net/bnxt: check device is started before flow creation 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Check device is started before flow creation. Since the vnic data structures aren't created until device start, the driver dereferences NULL vnic if flow creation is attempted before device is started, Reported-by: Stephen Hemminger Signed-off-by: Ajit Khaparde Reviewed-by: Somnath Kotur Reviewed-by: Venkat Duvvuru --- drivers/net/bnxt/bnxt_flow.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index 578081890..71a5266ce 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -1466,6 +1466,15 @@ bnxt_flow_create(struct rte_eth_dev *dev, int ret = 0; uint32_t tun_type; + if (!dev->data->dev_started) { + rte_flow_error_set(error, + EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, + "Device must be started"); + return NULL; + } + flow = rte_zmalloc("bnxt_flow", sizeof(struct rte_flow), 0); if (!flow) { rte_flow_error_set(error, ENOMEM, -- 2.20.1 (Apple Git-117)