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 49D81A04AD; Mon, 24 Jan 2022 18:47:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE532427FF; Mon, 24 Jan 2022 18:47:32 +0100 (CET) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mails.dpdk.org (Postfix) with ESMTP id 03C4B427EB for ; Mon, 24 Jan 2022 18:47:29 +0100 (CET) Received: by mail-pg1-f181.google.com with SMTP id j10so3881349pgc.6 for ; Mon, 24 Jan 2022 09:47:28 -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=m9Fhm5t+AxyhwGNqtgJo7EQpKlSWzjNFbTcX1SJZ86I=; b=j8i/yIKP5B+KGKvLE6GAieU+mivWHZiaKh9EYjQ51I/R7IdLYS+oS6G3QBZWYUJIJZ MHfiKrbjGlTjuj1xctPsYfZ4x0HGggoLeMIw2AtVeB8JDmmLK6vZnCNKzLc/tYPm3IsD /LW4mS0J27C1fOp2sw9GUT04Akndrqk/oSjvejPhEGuuBUpHu2B52OQd4HRy+rF7HRSQ Pkt1GzvHsrvIwxaxcodSM+N1BeBJuRzirFqzq7yNdf5USG8IUibTyX2FJiJh4fFwSyUS NNSDJYkt0eBvSJwbQMYgR2s+oOvl1tBKJ6M+jA5LxEYYoayrpuM2OZlXCMILbeNtj+ww poYQ== 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=m9Fhm5t+AxyhwGNqtgJo7EQpKlSWzjNFbTcX1SJZ86I=; b=aFzJ/r6Lh1RupEEc+oWhKSfW5/8LFczjouZGWzfrscY8ZdFnj6iHq/jqkRgnuQ6eMj CmmeoeoMgAJ8ypfZEjMH5qs4qotbIAMqD3aFm2u6l/9txCE6t4whj2wvwMWc/7U1tfnC hCSgOjbX4aoZw96oqjooHbf5SevN3EMW6Ie1RdhKVrjKLze50k1iBwHQj/KZV0jMUax/ Zhm9AoPmPrNplxtElOAm3mxVf3Jtww3TZRdULUyttIagUbEg7gnoi3W8txvE/TNeMKqV XwOwuIH2d7Z8XTWVHk4rl4WHWvj1t4/kvP3UaMBju6EYeFtCBE8Mh5gPujPYr5T8wlD5 nKgA== X-Gm-Message-State: AOAM532GXJ5nrxrNgJBkVO0CwQxdj22/k26tkr01gJBemmL84QYAntDu pwJ/fea57x5xYBnUS/Ag+ciTSG7m16qRbg== X-Google-Smtp-Source: ABdhPJzOilknKgVCnm3Oj/Rwn7w7pgPrJiIIEj57+3Bls7KhALPVVwHemuvUCsJ62GPZcMx6C+dcnQ== X-Received: by 2002:aa7:928e:0:b0:4ba:fa67:d87 with SMTP id j14-20020aa7928e000000b004bafa670d87mr14790125pfa.41.1643046448047; Mon, 24 Jan 2022 09:47:28 -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.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:27 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v2 06/83] examples/ip_pipeline: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:02 -0800 Message-Id: <20220124174719.14417-7-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 --- examples/ip_pipeline/cli.c | 12 ++++-------- examples/ip_pipeline/cryptodev.c | 6 ++---- examples/ip_pipeline/thread.c | 6 ++---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index 0c372675a919..c918f30e06f3 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -3773,10 +3773,8 @@ parse_free_sym_crypto_param_data(struct rte_table_action_sym_crypto_params *p) switch (xform[i]->type) { case RTE_CRYPTO_SYM_XFORM_CIPHER: - if (p->cipher_auth.cipher_iv.val) - free(p->cipher_auth.cipher_iv.val); - if (p->cipher_auth.cipher_iv_update.val) - free(p->cipher_auth.cipher_iv_update.val); + free(p->cipher_auth.cipher_iv.val); + free(p->cipher_auth.cipher_iv_update.val); break; case RTE_CRYPTO_SYM_XFORM_AUTH: if (p->cipher_auth.auth_iv.val) @@ -3785,10 +3783,8 @@ parse_free_sym_crypto_param_data(struct rte_table_action_sym_crypto_params *p) free(p->cipher_auth.cipher_iv_update.val); break; case RTE_CRYPTO_SYM_XFORM_AEAD: - if (p->aead.iv.val) - free(p->aead.iv.val); - if (p->aead.aad.val) - free(p->aead.aad.val); + free(p->aead.iv.val); + free(p->aead.aad.val); break; default: continue; diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c index 9997d974563f..cd0f9c3d4eac 100644 --- a/examples/ip_pipeline/cryptodev.c +++ b/examples/ip_pipeline/cryptodev.c @@ -151,10 +151,8 @@ cryptodev_create(const char *name, struct cryptodev_params *params) return cryptodev; error_exit: - if (cryptodev->mp_create) - rte_mempool_free(cryptodev->mp_create); - if (cryptodev->mp_init) - rte_mempool_free(cryptodev->mp_init); + rte_mempool_free(cryptodev->mp_create); + rte_mempool_free(cryptodev->mp_init); free(cryptodev); diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c index b2e97327052f..82d5f87c384c 100644 --- a/examples/ip_pipeline/thread.c +++ b/examples/ip_pipeline/thread.c @@ -92,11 +92,9 @@ thread_free(void) continue; /* MSGQs */ - if (t->msgq_req) - rte_ring_free(t->msgq_req); + rte_ring_free(t->msgq_req); - if (t->msgq_rsp) - rte_ring_free(t->msgq_rsp); + rte_ring_free(t->msgq_rsp); } } -- 2.30.2