rdma: Get rid of dev_map_free call

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@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
Leon Romanovsky 2017-12-27 09:57:56 +02:00 committed by David Ahern
parent b55644412f
commit b1e6bc437f
1 changed files with 2 additions and 10 deletions

View File

@ -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);
}
}