From patchwork Mon Apr 30 15:32:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Doherty, Declan" X-Patchwork-Id: 39180 X-Patchwork-Delegate: helin.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 05BE51DBE; Mon, 30 Apr 2018 17:41:12 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6DABC1C01 for ; Mon, 30 Apr 2018 17:41:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2018 08:41:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,346,1520924400"; d="scan'208";a="35737852" Received: from dwdohert-ws.ir.intel.com ([163.33.210.60]) by fmsmga007.fm.intel.com with ESMTP; 30 Apr 2018 08:41:08 -0700 From: Declan Doherty To: dev@dpdk.org Cc: Declan Doherty Date: Mon, 30 Apr 2018 16:32:58 +0100 Message-Id: <20180430153258.1101-3-declan.doherty@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180430153258.1101-1-declan.doherty@intel.com> References: <20180430153258.1101-1-declan.doherty@intel.com> Subject: [dpdk-dev] [PATCH 3/3] net/ixgbe: add null pointer check for pf_ethdev 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" Add NULL parameter check for rte_eth_dev_allocated() API call to eth_ixgbe_pci_probe(). Coverity Issue: 277216 Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports") Signed-off-by: Declan Doherty --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 283dd7e49..75f927c06 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1747,6 +1747,9 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_eth_dev *pf_ethdev = rte_eth_dev_allocated( pci_dev->device.name); + if (pf_ethdev == NULL) + return -ENODEV; + for (i = 0; i < eth_da.nb_representor_ports; i++) { struct ixgbe_vf_info *vfinfo; struct ixgbe_vf_representor representor;