From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 64E66A0C4B; Tue, 20 Jul 2021 18:01:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E41ED4068B; Tue, 20 Jul 2021 18:01:06 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.228]) by mails.dpdk.org (Postfix) with ESMTP id F193B40689 for ; Tue, 20 Jul 2021 18:01:05 +0200 (CEST) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 330DB2E5CA; Tue, 20 Jul 2021 14:31:43 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 330DB2E5CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1626816705; bh=3p5EWbIml4bOCsUuWjaj/m3730vgHH+h6LAeHmq7q/U=; h=From:To:Cc:Subject:Date:From; b=ERnV3YdcpcfjuzLLIQrpfD6ToLyUDtWKqgiGznD3L7MxBaOi5fMiB9UCAbOZtbgRQ OohNTCxS2lISJcMK0oj2GlyzeidqWdTdgbmy6XHfKKvVrzAvds+H5bpVZwkZ8QTDzT mkFwEewJZswbbxeR/7DfMAsTh/QZ6+epY1vlSgzc= From: Kalesh A P To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com Date: Tue, 20 Jul 2021 21:51:58 +0530 Message-Id: <20210720162158.5883-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 Subject: [dpdk-dev] [PATCH] net/bnxt: fix null pointer dereferences X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 Coverity reports that pointer "cpr->cp_ring_struct" may be dereferenced with null value. This patch fixes this. Coverity issue: 372063 Fixes: 5ed30db87fa8 ("net/bnxt: fix missing barriers in completion handling") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Lance Richardson --- drivers/net/bnxt/bnxt_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c index ebdac83..122a1f9 100644 --- a/drivers/net/bnxt/bnxt_irq.c +++ b/drivers/net/bnxt/bnxt_irq.c @@ -33,7 +33,6 @@ void bnxt_int_handler(void *param) return; raw_cons = cpr->cp_raw_cons; - cp_ring_size = cpr->cp_ring_struct->ring_size; pthread_mutex_lock(&bp->def_cp_lock); while (1) { if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.doorbell) { @@ -46,6 +45,7 @@ void bnxt_int_handler(void *param) return; } + cp_ring_size = cpr->cp_ring_struct->ring_size; cons = RING_CMP(cpr->cp_ring_struct, raw_cons); cmp = &cpr->cp_desc_ring[cons]; -- 2.10.1