From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by dpdk.org (Postfix) with ESMTP id 8CB3F3796 for ; Tue, 7 Apr 2015 23:21:03 +0200 (CEST) Received: by pacyx8 with SMTP id yx8so91041074pac.1 for ; Tue, 07 Apr 2015 14:21:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=n232PlMLdgZNZZJEgWup3ILdY45ZC7j6k5QmPB6RoZA=; b=aZzqd9xbrv9XQKvLopaic32uAobkB23GhTamQTcW4v/VC4i0/a/iFcZxJjR+gQXaDb Gg4gD2kwRYvgPciRWRvQ/NI4+o+Z4/NxTaz/TJ71Kr7KmQIr/0fnW+4qAUHvn8Mg4LNc tkzXQDTg0jZ7R0e0T/li4PZxxSCwZ7l5K9qGPOH0dFpJfEi2mkrfec+pg7rsIXjN30IU VbUaGDxNiN3xcXI/bZesX99mjb+ufRSeqxVuwKd8R00cPWX+QmY5ZAj4zaefy1HoDRME UK6JT5T+05ZnOZQ7Nu9RO2rh87S582DvGH6RFuLxTGEx80OcKMwSSnr6hJexi+OevUX3 fZdA== X-Gm-Message-State: ALoCoQlZ+pcRvOBm2Rdxc7rVd/sZvlx+FYH6NvYRDaOMRTrrzrQxLjh1o1DN007zKI3vuRokrFDB X-Received: by 10.66.65.106 with SMTP id w10mr41023912pas.122.1428441662691; Tue, 07 Apr 2015 14:21:02 -0700 (PDT) Received: from urahara.brocade.com (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id j2sm9020328pdn.44.2015.04.07.14.21.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Apr 2015 14:21:02 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Date: Tue, 7 Apr 2015 14:20:59 -0700 Message-Id: <1428441663-3825-2-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1428441663-3825-1-git-send-email-stephen@networkplumber.org> References: <1428441663-3825-1-git-send-email-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v2 2/6] test: remove useless check of NULL before rte_free X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2015 21:21:03 -0000 rte_free like Glibc free allows rte_free(NULL) as null operation. Signed-off-by: Stephen Hemminger --- app/test/test_hash_perf.c | 2 +- app/test/virtual_pmd.c | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index bd531ec..6eabb21 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -387,7 +387,7 @@ struct tbl_perf_test_params tbl_perf_params[] = if (cond) { \ printf("ERROR line %d: " str "\n", __LINE__, ##__VA_ARGS__); \ if (handle) rte_fbk_hash_free(handle); \ - if (keys) rte_free(keys); \ + rte_free(keys); \ return -1; \ } \ } while(0) diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 39ecf80..1f4da96 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -635,18 +635,12 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, return eth_dev->data->port_id; err: - if (pci_dev) - rte_free(pci_dev); - if (pci_drv) - rte_free(pci_drv); - if (eth_drv) - rte_free(eth_drv); - if (dev_ops) - rte_free(dev_ops); - if (id_table) - rte_free(id_table); - if (dev_private) - rte_free(dev_private); + rte_free(pci_dev); + rte_free(pci_drv); + rte_free(eth_drv); + rte_free(dev_ops); + rte_free(id_table); + rte_free(dev_private); return -1; } -- 2.1.4