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 3130EA0471 for ; Tue, 16 Jul 2019 11:28:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFFF22BF4; Tue, 16 Jul 2019 11:28:39 +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 544A82BE1 for ; Tue, 16 Jul 2019 11:28:38 +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 5D98630C03C; Tue, 16 Jul 2019 02:28:35 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 5D98630C03C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563269315; bh=SxE7+6obtjLZnCYUyITtjSg4RDGYY3FYkyhdlpg3Ibg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l1LXd6lXTfW9C7dwNFMZ1sXsYzTIkGE7IyzAj/5YpOjYqFwtHrfzwrG05oq2pRjxS e4/mJQgGxyxDgUcJDsMC3TMOwtGNRBMN0MznGT6vKHeiQhE2rwlr0K4SykCsBrHrf3 +BFNzaShYhDRkiCk0R5iRxHAvng0gT9jm3CgKd7A= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id BF892AC0749; Tue, 16 Jul 2019 02:28:33 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP Date: Tue, 16 Jul 2019 14:58:13 +0530 Message-Id: <20190716092826.54276-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190716092826.54276-1-ajit.khaparde@broadcom.com> References: <20190712060622.76975-1-ajit.khaparde@broadcom.com> <20190716092826.54276-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 02/15] net/bnxt: fix possible segfault in case of probe failure 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" From: Kalesh AP Fixed couple of possible segfaults due to NULL pointer dereference in case of probe failure. Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations") Signed-off-by: Kalesh AP Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_irq.c | 3 +++ drivers/net/bnxt/bnxt_vnic.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c index 0bb3eb4fa..61f7498a5 100644 --- a/drivers/net/bnxt/bnxt_irq.c +++ b/drivers/net/bnxt/bnxt_irq.c @@ -52,6 +52,9 @@ void bnxt_free_int(struct bnxt *bp) { struct bnxt_irq *irq; + if (bp->irq_tbl == NULL) + return; + irq = bp->irq_tbl; if (irq) { if (irq->requested) { diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index 262cfc18d..20e5bf2d1 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -89,6 +89,9 @@ void bnxt_free_vnic_attributes(struct bnxt *bp) struct bnxt_vnic_info *vnic; unsigned int i; + if (bp->vnic_info == NULL) + return; + for (i = 0; i < bp->max_vnics; i++) { vnic = &bp->vnic_info[i]; if (vnic->rss_table) { -- 2.20.1 (Apple Git-117)