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 580E8A0547; Mon, 24 May 2021 11:00:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B187410FE; Mon, 24 May 2021 11:00:48 +0200 (CEST) Received: from proxy.6wind.com (host.78.145.23.62.rev.coltfrance.com [62.23.145.78]) by mails.dpdk.org (Postfix) with ESMTP id 5CF144003C; Mon, 24 May 2021 11:00:46 +0200 (CEST) Received: from localhost (unknown [10.16.0.39]) by proxy.6wind.com (Postfix) with ESMTP id 494DD9B47A9; Mon, 24 May 2021 11:00:46 +0200 (CEST) From: Thierry Herbelot To: dev@dpdk.org Cc: Thierry Herbelot , Thomas Monjalon , stable@dpdk.org, Ajit Khaparde , Somnath Kotur Date: Mon, 24 May 2021 11:00:38 +0200 Message-Id: <20210524090038.16580-1-thierry.herbelot@6wind.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/bnxt: do not use possibly NULL pointers 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" Check that pointers are valid before using them. Fixes: 7bc8e9a227ccb ("net/bnxt: support async link notification") Cc: stable@dpdk.org Cc: Ajit Khaparde Cc: Somnath Kotur Signed-off-by: Thierry Herbelot --- drivers/net/bnxt/bnxt_irq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c index 8abbadb3d19d..fd8b8fac989a 100644 --- a/drivers/net/bnxt/bnxt_irq.c +++ b/drivers/net/bnxt/bnxt_irq.c @@ -21,11 +21,14 @@ void bnxt_int_handler(void *param) { struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param; struct bnxt *bp = eth_dev->data->dev_private; - struct bnxt_cp_ring_info *cpr = bp->async_cp_ring; + struct bnxt_cp_ring_info *cpr; struct cmpl_base *cmp; uint32_t raw_cons; uint32_t cons; + if (bp == NULL) + return; + cpr = bp->async_cp_ring; if (cpr == NULL) return; -- 2.29.2