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 23777A04AD; Mon, 24 Jan 2022 18:51:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4535742902; Mon, 24 Jan 2022 18:48:17 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 39A3C428F1 for ; Mon, 24 Jan 2022 18:48:14 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id s61-20020a17090a69c300b001b4d0427ea2so21160923pjj.4 for ; Mon, 24 Jan 2022 09:48: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=2b55N7bXSpRzSFdGI25U4RUzQpLVPxW/BVtkfhv0RJ0=; b=fNRy0S9ODPv9GdESYjGkrpbcoLsPpxvFiIrwlU1oyR/lAsGtp4/Zzb6MwDuo2KIvck /1O2Fnn6dZt2GD1Ua97BTA0kaon2oREza4UKGTbVxfLLCtqGzk6arsN3LEwg0wYTJEcm N5sJfnGqwR32I3fzJAg+VeoMLb9pB7TVhu5U0PHrNASLESvH0G++VTUSmX6TBCCIJaF5 +/lBqyTlm0K9Y0Ersi/kFLr6RRbf8v9VWKnl9I0DKKJQAZU3qe8DPWOb1ROD/toBHcqk Boja9w7K6pz+58ZNqo3tglTo7cTtZ0vV1atZMQe3xkNOjqPHdX/ajZzZrpwf6JWKFbOB A1tw== 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=2b55N7bXSpRzSFdGI25U4RUzQpLVPxW/BVtkfhv0RJ0=; b=dqpjNF2Nu0S758X1KR3lIeZiB2dTfYNBUvvE9nVvbtNk1DqQOEr9CUaXtKThVWsRVE R+402PutnQys3jefM2LCv4LuaUJ1p1dOBMz7dx1GIePI2L+TcV8sbjmtk10DY15gjcA2 J+inA2lQSEzDcB6scmea0/TJk9nOJkK6sNgFItSLJ+qRL/+eFlOgNzQ9Wx1T7/LCeRuC yCnMAtodeVNN6GjcldH6DJZWaaT2TDNhPzbZ284JyqlpDWp+hutY8T3NQS1s2IhWFxhN V3L8OqoGPgaQ1SMMGGUFvll5zEIJD40P+UlWBo/PPTmZ9Gry1ZwoW0+nEkgBbcmIC6rs f1jg== X-Gm-Message-State: AOAM532Aa2JzPonecNQAnBhLC2Vg1fKdtOGUVUr3JxBSB6S7DNBLgiLc UingDH/sGUHf0S6/5tVStmx6pQ52AdWPRw== X-Google-Smtp-Source: ABdhPJxTlu/GetJoekYpCLDbd/W//FDLxGurmI9mqNLqy1Lgl931yiRpLo6t1fOR7GLsKDMB0YkDog== X-Received: by 2002:a17:903:4101:b0:14a:cae5:48a with SMTP id r1-20020a170903410100b0014acae5048amr15406036pld.25.1643046493260; Mon, 24 Jan 2022 09:48:13 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q7sm15835082pfs.37.2022.01.24.09.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:48:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH v2 47/83] net/dpaa2: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:43 -0800 Message-Id: <20220124174719.14417-48-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124174719.14417-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124174719.14417-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/dpaa2/dpaa2_ethdev.c | 3 +-- drivers/net/dpaa2/dpaa2_mux.c | 3 +-- drivers/net/dpaa2/dpaa2_ptp.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 2b04f1416853..6b85b7740cfa 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -504,8 +504,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 8d79e392445a..5fcc36abe7b0 100644 --- a/drivers/net/dpaa2/dpaa2_ptp.c +++ b/drivers/net/dpaa2/dpaa2_ptp.c @@ -168,8 +168,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.30.2