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 C707EA00C5; Tue, 4 Jan 2022 09:20:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2DC141183; Tue, 4 Jan 2022 09:19:26 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 1DD9241145 for ; Tue, 4 Jan 2022 09:19:25 +0100 (CET) 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 5F626C0000F2; Tue, 4 Jan 2022 00:19:23 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 5F626C0000F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1641284364; bh=VrlrL+TmVoHO1+eoHkvnGnEATtvKfxREu8ZwdmfEtcQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qxdkXUADVuP7hd0qRZJe0OFbpVv2/MjDOEyZKIETW3qhZ4xN1lnJ4gDINah+VS7G9 XDwiSJPh3DC7Kq02L/wcMdc7QroxQbH2Fx29YaPouNjXJSDjVPu7RlJZecDRH6qkuw 77+KA0ODD+sxz5h33SB7vTAyeGYtIrwsBZ71NvC4= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 09/18] net/bnxt: add null check for mark table Date: Tue, 4 Jan 2022 14:08:15 +0530 Message-Id: <20220104083824.23001-10-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220104083824.23001-1-kalesh-anakkur.purayil@broadcom.com> References: <20220104083824.23001-1-kalesh-anakkur.purayil@broadcom.com> 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 From: Kalesh AP During the port start, driver ignores mark table allocation failure. This could cause a segfault due to NULL pointer dereference in bnxt_set_mark_in_mbuf(). Fix this by checking the pointer validity before accessing it. Fixes: b87abb2e55cb ("net/bnxt: support marking packet") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_rxr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 44247d7..9621809 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -824,6 +824,9 @@ void bnxt_set_mark_in_mbuf(struct bnxt *bp, { uint32_t cfa_code = 0; + if (unlikely(bp->mark_table == NULL)) + return; + cfa_code = rte_le_to_cpu_16(rxcmp1->cfa_code); if (!cfa_code) return; -- 2.10.1