From patchwork Mon Jan 24 00:04:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 106293 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B4DDA034F; Mon, 24 Jan 2022 01:10:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD776428DC; Mon, 24 Jan 2022 01:06:23 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 1D3954285C for ; Mon, 24 Jan 2022 01:06:19 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id w12-20020a17090a528c00b001b276aa3aabso19114702pjh.0 for ; Sun, 23 Jan 2022 16:06:19 -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=tpchy6wepQlqev+R7Ezt6aGM3ua5K4iRFgPL0yJtdMI=; b=lldH8/wKUJ1rYgEdQnPoAhuWqV9NZnn6Wd8lYxIgC8t0ebe3IAvjmKpTe6dm+JGTE/ VLeky53yxeJi1apB5SjYp+cIQk0/+7fHelye7qK7XCNCLX5GvcKMYlnEc3bvgHFH6TtC yshwG1M8swi0KlCZFdykoYzmTL3jWZleqTs7IlzxQWmqTYZAXJxmYV2MFqeNQb+UtbUp cjQXjSg0jk1J5J/nAfnrZHhoU+ca26HZWNkLNl22+MCEvbz1Dna+hdoBdoRzVRcK4IYW gwr9xDHmTEaqnPhIz9Iz3MYN7SkUzOsin61vKw0ipu1mK8i8gQIRN7fTXLfw9nI5jVvo X22Q== 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=tpchy6wepQlqev+R7Ezt6aGM3ua5K4iRFgPL0yJtdMI=; b=vaojGagipTduO4JF0N4K+rwesjbuVrqbQv6X6PnLfRyWWmaJ1xu+YSlD1Fm28A5Gc3 BPpZEu1Oh37XzqNEgUKoWwqILJEhDpeNb3pPRy5142dPqs5qDTzWPmkJyTxsZf9vcWVh 7QY4Ekzmq6h/msbi1X7hjvJRA5SJ27CHOoLP5ytAfMOsGhCJJLpBJY/4uG25Jxn4Xa5c 7g5ByqC1pXwVIsJmz/F2xjdEY9DXFA84Dc/3ZveoeURC8ft6MJPcOsyhZmXQs0BTFzGB iwlTzbtkoeAHMQrhiJh4+2x+l04dOe9RQNNkOiZqHZtl7ucfrCWz/DhY7bxuOhuthSqu Q5iw== X-Gm-Message-State: AOAM531cJ7zWGUY5hdj8CmSM715PkKGWCmpHQ6M50jhnjiUUUCH/oY58 gx8kHDnr3T5I2FYN4I/Iel9ZBtdokZYDZg== X-Google-Smtp-Source: ABdhPJySagq8gGyH2YNHIDZDYgiXrxOSp0K718xpxgxZbST2evBkvmEjbR9sysDK8IeczJQs54F1yw== X-Received: by 2002:a17:90a:8807:: with SMTP id s7mr10524255pjn.223.1642982778091; Sun, 23 Jan 2022 16:06:18 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id ck21sm10935350pjb.51.2022.01.23.16.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:06:17 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Haiyue Wang Subject: [PATCH 54/82] net/ixgbe: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:50 -0800 Message-Id: <20220124000518.319850-55-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124000518.319850-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> MIME-Version: 1.0 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 --- drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++------- drivers/net/ixgbe/ixgbe_rxtx.c | 3 +-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index c8f0460440c0..840509ddd460 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1322,10 +1322,8 @@ static int ixgbe_fdir_filter_uninit(struct rte_eth_dev *eth_dev) IXGBE_DEV_PRIVATE_TO_FDIR_INFO(eth_dev->data->dev_private); struct ixgbe_fdir_filter *fdir_filter; - if (fdir_info->hash_map) rte_free(fdir_info->hash_map); - if (fdir_info->hash_handle) - rte_hash_free(fdir_info->hash_handle); + rte_hash_free(fdir_info->hash_handle); while ((fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list))) { TAILQ_REMOVE(&fdir_info->fdir_list, @@ -1343,10 +1341,8 @@ static int ixgbe_l2_tn_filter_uninit(struct rte_eth_dev *eth_dev) IXGBE_DEV_PRIVATE_TO_L2_TN_INFO(eth_dev->data->dev_private); struct ixgbe_l2_tn_filter *l2_tn_filter; - if (l2_tn_info->hash_map) - rte_free(l2_tn_info->hash_map); - if (l2_tn_info->hash_handle) - rte_hash_free(l2_tn_info->hash_handle); + rte_free(l2_tn_info->hash_map); + rte_hash_free(l2_tn_info->hash_handle); while ((l2_tn_filter = TAILQ_FIRST(&l2_tn_info->l2_tn_list))) { TAILQ_REMOVE(&l2_tn_info->l2_tn_list, diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 99e928a2a971..9e8ea366a506 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2983,8 +2983,7 @@ ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq) rxq->rx_tail = 0; rxq->nb_rx_hold = 0; - if (rxq->pkt_first_seg != NULL) - rte_pktmbuf_free(rxq->pkt_first_seg); + rte_pktmbuf_free(rxq->pkt_first_seg); rxq->pkt_first_seg = NULL; rxq->pkt_last_seg = NULL;