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 DD0D0A0471 for ; Wed, 17 Jul 2019 12:43:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C518E1BDE7; Wed, 17 Jul 2019 12:42:17 +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 1F3761B9AF for ; Wed, 17 Jul 2019 12:42:07 +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 DCECB30C0A1; Wed, 17 Jul 2019 03:42:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com DCECB30C0A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563360125; bh=vz1g52IDXz8RUniqKzoQVwPk10PbTpi9WL5Fev2MDTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WphXDjno2Q3aZQTRRsPPvpIV/kFNPpBs22elX2AMo8XB02PLXGnxUWBQNGJSD/7e/ V3YIxmFKL++tphw89e3kzDoGvx8OlOMgfYqN5MLi2JXZko6JdsZulA7Qilb4/1vC5S c4npNj68lsDVfB7LUbDwjlsOYLNSS13lpsncYkLs= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 819A1AC0749; Wed, 17 Jul 2019 03:42:04 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Lance Richardson Date: Wed, 17 Jul 2019 16:11:34 +0530 Message-Id: <20190717104139.21155-11-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190717104139.21155-1-ajit.khaparde@broadcom.com> References: <0c1b327c-2c36-652f-c88d-cbca8f873c13@intel.com> <20190717104139.21155-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 10/15] net/bnxt: avoid null pointer dereference 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: Lance Richardson Avoid null pointer dereference when allocating an insolated completion ring by basing nq ring allocation on whether an nq ring was requested instead of whether the device supports nq rings. Fixes: f8168ca0e690 ("net/bnxt: support thor controller") Signed-off-by: Lance Richardson Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index faf861cc1..ada748c05 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -280,7 +280,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, } cp_ring_info->hw_stats_ctx_id = HWRM_NA_SIGNATURE; - if (BNXT_HAS_NQ(bp)) { + if (nq_ring_info) { struct bnxt_ring *nq_ring = nq_ring_info->cp_ring_struct; nq_ring->bd = (char *)mz->addr + nq_ring_start; -- 2.20.1 (Apple Git-117)