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 A0F22A034E; Wed, 9 Feb 2022 20:20:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35299426E1; Wed, 9 Feb 2022 20:18:17 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 352EE426D9 for ; Wed, 9 Feb 2022 20:18:14 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id x3so3083668pll.3 for ; Wed, 09 Feb 2022 11:18:14 -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=siYBAQGezS0yKylyATPn+333klag5C8rOcJM9KOCeZM=; b=4p4IrTE8qXMcSpkMXsnnH+HVr/lXGdBaZHSTwk5n8Wbegcu9n2Wd5smHZSVYbj2TGT I+3rrvLYoDg1xnI9MLRgpqEG5357eDDq+sABMwaHKwIBXDNrnYVaDwXiX6ujzqI57pId 7+FprzANmFOFz3hgGqheB0byRmI7KH8KfCdFe3CT3mnE0DN87LOgX7+hPwDMq56+VMCr XRvxIMzfghr/kK276P1SQdSifOgVO8ikJshh4d6tu3d9vVABEvIhlwjTbChn9/M7Qcls BO5uuSFMP18n25AqjXEbVPmcEE35DGyEF2Ik2kE1RkWKxG96nP2n5zBtzI+B8Ui8UuIU 3PaA== 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=siYBAQGezS0yKylyATPn+333klag5C8rOcJM9KOCeZM=; b=mUz26rLflRTVmdfj7R3us7c/VwUk4wAtCcJZ/lz/W72XRZhpTkT/ywwALaWs8rBFmO 6ysr/YhmYt4Q+mz2gbvNl8V5Keh3wQ8E6qkaSRqPFblqWJ4TG1m370buhVyZBK+RHJno 0dHJLaTjV3DbNduwmWMH1QrN1vCD6vrOJTQs4J0wNI7n7kysN5AQVYkjBOxrd7/noTdh egn58Ez5Mb/DICpmB0aVGuP69bZTEwp8P+bjCs2lVh4G8pX6bjg6WJKzZJwv2++ubQrJ dZZyo5+UDJ7RY+oGSr+B0d6iQhhLF47+iMhAk6jNLnWUCSYjCVn9aOlAQvHhkGWqJOBx kWZg== X-Gm-Message-State: AOAM530OmOx5CbX97zLYJcG7Z8wpJcX6czaCR4RfaMWXjwlyO1qrH9tr 9GUvBtXqk2Nws8GQSJHeBMCkjcsfnK5BQLxuGDI= X-Google-Smtp-Source: ABdhPJwkCwJsld4SY0VvUyXXkAzxoXgaWd5H4RfHdQHqvQwrc49DNAKPtloQ3ePOWVqtxxE68QDCfA== X-Received: by 2002:a17:90b:1bc7:: with SMTP id oa7mr4982996pjb.149.1644434293053; Wed, 09 Feb 2022 11:18:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:18:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH v3 18/36] net/dpaa*: remove unnecessary NULL checks Date: Wed, 9 Feb 2022 11:17:30 -0800 Message-Id: <20220209191748.377729-19-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: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 3 +-- drivers/net/dpaa/fmlib/fm_lib.c | 3 +-- drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- drivers/net/dpaa2/dpaa2_mux.c | 3 +-- drivers/net/dpaa2/dpaa2_ptp.c | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index b0c78ac0a14e..bddb3bb15ccc 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -474,8 +474,7 @@ static int dpaa_eth_dev_close(struct rte_eth_dev *dev) } /* release configuration memory */ - if (dpaa_intf->fc_conf) - rte_free(dpaa_intf->fc_conf); + rte_free(dpaa_intf->fc_conf); /* Release RX congestion Groups */ if (dpaa_intf->cgr_rx) { diff --git a/drivers/net/dpaa/fmlib/fm_lib.c b/drivers/net/dpaa/fmlib/fm_lib.c index 0d1ca12378d8..1d6816050c2f 100644 --- a/drivers/net/dpaa/fmlib/fm_lib.c +++ b/drivers/net/dpaa/fmlib/fm_lib.c @@ -408,8 +408,7 @@ fm_port_close(t_handle h_fm_port) _fml_dbg("Calling...\n"); close(p_dev->fd); - if (p_dev->h_user_priv) - free(p_dev->h_user_priv); + free(p_dev->h_user_priv); free(p_dev); _fml_dbg("Finishing.\n"); diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 09105f049e89..e824ae15b5ed 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -508,8 +508,7 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) /* cleaning up queue storage */ for (i = 0; i < priv->nb_rx_queues; i++) { dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; - if (dpaa2_q->q_storage) - rte_free(dpaa2_q->q_storage); + rte_free(dpaa2_q->q_storage); } /* cleanup tx queue cscn */ for (i = 0; i < priv->nb_tx_queues; i++) { diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c index cd2f7b8aa544..bd4596b89149 100644 --- a/drivers/net/dpaa2/dpaa2_mux.c +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -353,8 +353,7 @@ dpaa2_create_dpdmux_device(int vdev_fd __rte_unused, return 0; init_err: - if (dpdmux_dev) - rte_free(dpdmux_dev); + rte_free(dpdmux_dev); return -1; } diff --git a/drivers/net/dpaa2/dpaa2_ptp.c b/drivers/net/dpaa2/dpaa2_ptp.c index 3a4536dd69c1..4e6d375d1cbb 100644 --- a/drivers/net/dpaa2/dpaa2_ptp.c +++ b/drivers/net/dpaa2/dpaa2_ptp.c @@ -170,8 +170,7 @@ dpaa2_create_dprtc_device(int vdev_fd __rte_unused, return 0; init_err: - if (dprtc_dev) - rte_free(dprtc_dev); + rte_free(dprtc_dev); return -1; } -- 2.34.1