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 90AFBA034E; Wed, 9 Feb 2022 20:20:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38AFD426F5; Wed, 9 Feb 2022 20:18:20 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id CD268426E4 for ; Wed, 9 Feb 2022 20:18:17 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id x3so3083789pll.3 for ; Wed, 09 Feb 2022 11:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BBkwC9NcWpsF9IcK0UI0VOSakhsJrHfUKo1zdmKUadM=; b=Rx+nyWj82rsrRuf1HCI1W1qMVYVBWDYFUL3zqYjEGK+Q+MQQzsimZ/dk6+YBEbI8Zx l53arYZ3oPmILP52JN6niXMJBLRNHDbQr3BxTvz1YxEJRlxGb8gVygFBbgRpktePdeRo ZSQ1C5JDSYXtPqtanNXglarlI0WUY65wU1ztFR8jYHSNDeIGEeU6vMUsOh8uqBtW67GG dI9fYpApojv0X1S2AIbG3nvev3KFI1gQSHorU/+qBaByQMyxAxvoA1dE4p9aGK0/v326 8ko6acYE7/4qYAV9kVahNoa1HjRiFcP1/slZZ5RGDroavWBMo/UEPR/s2YEHldQ5SOT3 ekGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BBkwC9NcWpsF9IcK0UI0VOSakhsJrHfUKo1zdmKUadM=; b=rqMY9zq8dttCOtlBnh2++OStH8ML5f10XtyDP4nU0K6qOn+pA6YDobDeDHfKy6j6h7 FDhQ4Wcim774+gX0XzpNILAZqGx3qVrpBbE6FGRNh/UcZIiweXjsJxkgDTs7n7Z5pSxO XQjVzSX5EagcGLo/ELV/kGIjquyur2iSzTFKJmr/yfcvkY6YfiATXNVtjU/jFfEyRFtg 2rP9QNt+YTqpXz9bRLRVBwfoYz1z1nQj72hnqht/SGgQOYP/NJ/jty9c1mCYFiF4Xtg3 EtAn481m2pPmBHcU8dv8fYaWvO11ebZrkrYxxpI6TC1X4Ai1D7Mz9JQ/5MGvInc7X9Fd kgYQ== X-Gm-Message-State: AOAM532b5K/o/3ydUBX9WEEaZ1SnXBcMs4an09uW9b2DzqJVTd5rDd+C UOXvsMoxh58YSCO11uGNOf26KsrMmFDfXQzp2L8= X-Google-Smtp-Source: ABdhPJwKy2dNtdhGWYgwLug0OmjVh9ZT7qwynPUlSMmEOfID5eoCirOd5l940wQ1S/qLl2nnINy7lA== X-Received: by 2002:a17:902:e2d3:: with SMTP id l19mr3646515plc.103.1644434296805; Wed, 09 Feb 2022 11:18:16 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u16sm14378401pgh.54.2022.02.09.11.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:16 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Min Hu , Yisen Zhuang , Lijun Ou Subject: [PATCH v3 21/36] net/hns3: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:33 -0800 Message-Id: <20220209191748.377729-22-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220209191748.377729-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220209191748.377729-1-stephen@networkplumber.org> 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 Remove redundant NULL pointer checks before free functions found by nullfree.cocci Signed-off-by: Stephen Hemminger Acked-by: Min Hu (Connor) --- drivers/net/hns3/hns3_rxtx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 3b72c2375a60..2d98db377f72 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -86,8 +86,7 @@ hns3_rx_queue_release(void *queue) hns3_rx_queue_release_mbufs(rxq); if (rxq->mz) rte_memzone_free(rxq->mz); - if (rxq->sw_ring) - rte_free(rxq->sw_ring); + rte_free(rxq->sw_ring); rte_free(rxq); } } @@ -100,10 +99,8 @@ hns3_tx_queue_release(void *queue) hns3_tx_queue_release_mbufs(txq); if (txq->mz) rte_memzone_free(txq->mz); - if (txq->sw_ring) - rte_free(txq->sw_ring); - if (txq->free) - rte_free(txq->free); + rte_free(txq->sw_ring); + rte_free(txq->free); rte_free(txq); } } -- 2.34.1