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 088BCA04AD; Mon, 24 Jan 2022 18:48:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C14BF4282E; Mon, 24 Jan 2022 18:47:39 +0100 (CET) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id 233A04281D for ; Mon, 24 Jan 2022 18:47:37 +0100 (CET) Received: by mail-pf1-f181.google.com with SMTP id 192so13238951pfz.3 for ; Mon, 24 Jan 2022 09:47:37 -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=GbkxgaXp/fRgtcJ/RW7KltB2CwwQEUAaehPejDsnCANYdDkfphPiq8FEw4bRpPyCLE E2d6Z6Cyr4x1CtYRwHUg5Aa1D7ws6G8RcqpMNVj/QS5GB4vxRPfmED0Pr9XVdeTDG+I9 KbKT0DqOrgrgEw31OlWfNlmEvCtOSfaOw9nBSOjo4izTVFz+dX6z109i6uQVH5YBZpWd SOzAIAD96xw3mnziU9jY9+cNIjoHeGB7cUXRfL5h6WP+g+8988Zjg99EbYBwJlNhkkDs +kprbx1mpGfRxnxq//091yvviPHPRe/8FLB5Ckv/X9HvCEhBQmm8G2gMiIQf/xzs8iIk VS4A== 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=Gq9jp2S9VYX1P8WkTqiVsQDvkHpSjblh+GzndsiLdxgM9JmE0UIjLJBjdaueJbREzV 12u+mJu0XiVR3vHtOwI5IFmq2cVZe9jskd91XQB/jGQXpqyNc4LJFap42zWtIjziAFf5 5+B+f1TMOf6NJvrObSef4RUCX/yQh03K9GQ23YODAIYYmYWKLNScA6uUHZCXwWatwzgC j5T+JDe+VOjmCb3YEWdghIjoT7BJBVdLC5v+2wwz8tAcTtReJs4W2JCudu8L5B0r9PH0 4Cix78giIrZQnwYVqxvQe6dWnfAtfCtRq/XR0Y7AKHh3ClBwwa6tROU/vei1G70oLigq yCtw== X-Gm-Message-State: AOAM530OvT6sQ9j2ddynr6p/WSDlo2dskfMgL5yxCg2hXtw6mUAxi+YB dnGOIBT292qH97AUN/ECnOyU3DhYOdJuzQ== X-Google-Smtp-Source: ABdhPJxJfVAE6Haz6grILm1gJeYsn/fvCs+Jyxt8a23vFwY/9G08kub8BYaLmSHkLwQtwlHZMn6Gzg== X-Received: by 2002:a05:6a00:1892:b0:4c8:fdfd:a648 with SMTP id x18-20020a056a00189200b004c8fdfda648mr6032437pfh.58.1643046456145; Mon, 24 Jan 2022 09:47:36 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:35 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Xiaoyun Li , Aman Singh , Yuying Zhang Subject: [PATCH v2 13/83] app/test-pmd: remove unnecessary NULL checks Date: Mon, 24 Jan 2022 09:46:09 -0800 Message-Id: <20220124174719.14417-14-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 --- 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