From: Stephen Hemminger Date: Tue, 7 Apr 2015 21:20:59 +0000 (-0700) Subject: app/test: remove useless null check before rte_free X-Git-Tag: spdx-start~9321 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=517f8377106cefb8d5b49a85ef4b1c3b86dc0466;p=dpdk.git app/test: remove useless null check before rte_free rte_free like Glibc free allows rte_free(NULL) as null operation. Signed-off-by: Stephen Hemminger Acked-by: Neil Horman --- diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index bd531ec82f..6eabb21f36 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 39ecf8014e..1f4da96dd4 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; }