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 92C17A0471 for ; Tue, 16 Jul 2019 11:30:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE29B1BDF1; Tue, 16 Jul 2019 11:29:10 +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 B54F81B9C9 for ; Tue, 16 Jul 2019 11:28:52 +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 9D95B30C032; Tue, 16 Jul 2019 02:28:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 9D95B30C032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563269331; bh=vz1g52IDXz8RUniqKzoQVwPk10PbTpi9WL5Fev2MDTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PEOMp3DoJalaOWV1F67drD+8Tjpb1nEbgx5vcUba2MidjDhsLFIQpw/OW7ltvljmV voapLk+gpt8LF85+gEih7bxaep7CezLJgoNYDhKf4o2PN4WgFae+GENdL1/yMK2myp nxLUfsUdyoK9OgTwcoQU3XP/QjO+A7G7toMbTS3M= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id E7352AC0749; Tue, 16 Jul 2019 02:28:49 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Lance Richardson Date: Tue, 16 Jul 2019 14:58:21 +0530 Message-Id: <20190716092826.54276-11-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 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)