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 5A48DA00C2; Thu, 3 Nov 2022 20:56:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CE3D410EF; Thu, 3 Nov 2022 20:56:59 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 322444014F for ; Thu, 3 Nov 2022 20:56:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667505417; x=1699041417; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Lw1qbkc32ZJnUVVck+1Ntv/cTunVDszFec+nlK0P2Kk=; b=GVyLSNkh/2ks2utyAePTYhTIE+RGqmAtmOSx64ife6Dv1LD0Inu2zQ6N fJjH82XCO9D2Kb7kOUHGlbgLNelaaAC9bhbWK+mF43oAm+m+Ql1gPZ9g/ HuTj8d0BZD8LWu++W+vtcg5DK35kJ0QuLW3T707RU++64hXiDdc7iGiRK PgtQLKJwQHoB8fBnMlBE2INq1Z3i4tkBULVRJev51GsFBfNRoZmfSWURN +7C1mqsc5bwRjkOdxVoRVYiemKhvu7TxvP1SUg/MEwRUbupyaK1v2mRz3 zh+3PSH/pCljW99gObDi8cKOZ5NToB/3QltqrvYr98VXSTUW6AtaLfPBa w==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="310907716" X-IronPort-AV: E=Sophos;i="5.96,135,1665471600"; d="scan'208";a="310907716" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 12:56:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="634806518" X-IronPort-AV: E=Sophos;i="5.96,135,1665471600"; d="scan'208";a="634806518" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orsmga002.jf.intel.com with ESMTP; 03 Nov 2022 12:56:54 -0700 From: Hernan Vargas To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com, maxime.coquelin@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas Subject: [PATCH v1 1/1] baseband/acc: fix check after deref and dead code Date: Thu, 3 Nov 2022 20:52:09 -0700 Message-Id: <20221104035209.62109-2-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221104035209.62109-1-hernan.vargas@intel.com> References: <20221104035209.62109-1-hernan.vargas@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Fix potential issue of dereferencing a pointer before null check. Remove null check for value that could never be null. Coverity issue: 381646, 381631 Fixes: 989dec301a9 ("baseband/acc100: add ring companion address") Signed-off-by: Hernan Vargas --- drivers/baseband/acc/rte_acc100_pmd.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index 96daef87bc..30a718916d 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -4122,15 +4122,11 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data, struct rte_bbdev_enc_op *op; union acc_dma_desc *desc; - if (q == NULL) - return 0; #ifdef RTE_LIBRTE_BBDEV_DEBUG if (unlikely(ops == 0)) return 0; #endif desc = q->ring_addr + (q->sw_ring_tail & q->sw_ring_wrap_mask); - if (unlikely(desc == NULL)) - return 0; op = desc->req.op_addr; if (unlikely(ops == NULL || op == NULL)) return 0; -- 2.37.1