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 52823A04A6; Mon, 24 Jan 2022 01:06:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1B67427E2; Mon, 24 Jan 2022 01:05:37 +0100 (CET) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTP id DFAF7427ED for ; Mon, 24 Jan 2022 01:05:34 +0100 (CET) Received: by mail-pg1-f171.google.com with SMTP id t32so13625081pgm.7 for ; Sun, 23 Jan 2022 16:05:34 -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=Bqx1QikgD2/KxHs/wk6/R5yXCp85ron8ncDQ9vvSGQU=; b=iU6Uws9YPG0HJIUF10Yscv8Xzg2IabQ6/V0jJ3meB1fGlQ4auxfyceErPU1mBrkcDH RTPH/qogAlPkwzCXSJ3QJ7/0mxxIpDvyTtzkI7iFn30UNc7QdXWrLGZsgqodaW22d8bc /+HWbl2v6E72PaZ7thlhZntAfvVEd/4E9pRs4lfi7KfSczMWqbIhUpp7qQJpg4p/XAH+ ZMjilWxNtz5CeoLerORbb5zl1eH9b4Ccvu1vn+B/AMU/peeAfsct00wYCCeQjBf4PixP 5hKYPnwAb7QxLou59qJHBksw//2AL8gB/55Xjj9KeLQi3GAhdDiqUJhdp14FXHnHrBvm xO3A== 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=Bqx1QikgD2/KxHs/wk6/R5yXCp85ron8ncDQ9vvSGQU=; b=kMFsh7+fk7tjmgrpRPbBmo/8Ulhhz5O8SrX0AP6OvifQzdbIzCcO8Ed8FMlq9rPc1n rGqJ8SxkR3V8OYTl68hgWQcozt45dukufE38O2X/NeOa2/5FOJHSjPi0ykQiICliM37d ACMJHzCNx1Uos5TZjn1k6EuIiMeqHUZkcLryT8A0uoxKu8sZ0UVz5JnBOw4J1aie6iJ9 SN2nLpKvqOYQdTPM5iVHF3xM3yrcqDrdV0N75xX+gvOvWKLPtrWvH32HSS0r6NPptrmL Cs1bzunbk3oAmA1tmZBpMq+DI7rA1wnT80m2/pGrNb5vmoigtMg/UdkmCjveXnFDKvS8 x36w== X-Gm-Message-State: AOAM533aF4+hAJQ8yj51BO8/2/Z2gXkA8nyFRqNTVEQ/gy3O9y1XQmQ3 VfIimEG2KopBF03SQjUylO3EgH7YyNPzPQ== X-Google-Smtp-Source: ABdhPJzy/uXOxnIrRybC8zV8Ig/2AcsLKuUr/RRRcCbGX94TCTM/l+07SFewwtNIAp2Erlqi75ee0w== X-Received: by 2002:a63:2a51:: with SMTP id q78mr10177600pgq.25.1642982733945; Sun, 23 Jan 2022 16:05:33 -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.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:05:33 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Xiaoyun Li , Aman Singh , Yuying Zhang Subject: [PATCH 12/82] app/test-pmd: remove unnecessary NULL checks Date: Sun, 23 Jan 2022 16:04:08 -0800 Message-Id: <20220124000518.319850-13-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 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 --- app/test-pmd/cmd_flex_item.c | 3 +-- app/test-pmd/cmdline.c | 3 +-- app/test-pmd/testpmd.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/cmd_flex_item.c b/app/test-pmd/cmd_flex_item.c index 908bcb3f47f8..9050825a81d7 100644 --- a/app/test-pmd/cmd_flex_item.c +++ b/app/test-pmd/cmd_flex_item.c @@ -364,8 +364,7 @@ flex_item_create(portid_t port_id, uint16_t flex_id, const char *filename) flow_error.message ? flow_error.message : ""); } out: - if (fp) - free(fp); + free(fp); } #else /* RTE_HAS_JANSSON */ diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index e626b1c7d9ee..298a594e709b 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -14696,8 +14696,7 @@ cmd_ddp_info_parsed( ret = 0; no_print_return: - if (proto) - free(proto); + free(proto); #endif if (ret == -ENOTSUP) fprintf(stderr, "Function not supported in PMD\n"); diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 6c387bde84e5..31efa0fe61e5 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -902,8 +902,7 @@ create_extmem(uint32_t nb_mbufs, uint32_t mbuf_sz, struct extmem_param *param, return 0; fail: - if (iovas) - free(iovas); + free(iovas); if (addr) munmap(addr, mem_sz); -- 2.30.2