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 1E42AA00E6 for ; Fri, 12 Jul 2019 08:08:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF3F91BDE3; Fri, 12 Jul 2019 08:07:11 +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 62D761B9ED for ; Fri, 12 Jul 2019 08:07:06 +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 2916030C342; Thu, 11 Jul 2019 23:07:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 2916030C342 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1562911625; bh=FNo5BH31TIfk0en0Cu1uwGJM7wIuPZCMPX/fCTdRIIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mSp5gdb/ysPJr4fQ+GjR3lWfGal0giy0PpcsIEUfq0Or/VOEvozqV6JqEcuyAY/Kx DOH1JrGSub+fg3x4KRfD5SHWWMRZSHLXKjGkBqIzLza5qYfradSWEVQv0hKUQ33oOc vJyIiun0hg+x9zdZwsiHgF7sv3zu5Yr2yyyl6lrU= Received: from localhost.localdomain (unknown [10.230.44.246]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id D6BD1AC074B; Thu, 11 Jul 2019 23:07:03 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Lance Richardson Date: Fri, 12 Jul 2019 11:36:17 +0530 Message-Id: <20190712060622.76975-11-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190712060622.76975-1-ajit.khaparde@broadcom.com> References: <20190712060622.76975-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 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 9e6074ae3..98853ea7a 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)