lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171227075759.15289-8-leon@kernel.org>
Date:   Wed, 27 Dec 2017 09:57:56 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     David Ahern <dsahern@...il.com>
Cc:     Leon Romanovsky <leonro@...lanox.com>,
        netdev <netdev@...r.kernel.org>,
        Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2-next 07/10] rdma: Get rid of dev_map_free call

From: Leon Romanovsky <leonro@...lanox.com>

The dev_map_free() is called once only and it is short,
so it is better to integrate it into the caller's site.

Signed-off-by: Leon Romanovsky <leonro@...lanox.com>
---
 rdma/utils.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/rdma/utils.c b/rdma/utils.c
index 998a178d..c1069967 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -71,15 +71,6 @@ static struct dev_map *dev_map_alloc(const char *dev_name)
 	return dev_map;
 }
 
-static void dev_map_free(struct dev_map *dev_map)
-{
-	if (!dev_map)
-		return;
-
-	free(dev_map->dev_name);
-	free(dev_map);
-}
-
 static void dev_map_cleanup(struct rd *rd)
 {
 	struct dev_map *dev_map, *tmp;
@@ -87,7 +78,8 @@ static void dev_map_cleanup(struct rd *rd)
 	list_for_each_entry_safe(dev_map, tmp,
 				 &rd->dev_map_list, list) {
 		list_del(&dev_map->list);
-		dev_map_free(dev_map);
+		free(dev_map->dev_name);
+		free(dev_map);
 	}
 }
 
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ