diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-11-05 12:28:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-11-05 12:28:49 +0000 |
commit | 8adda70cd102a3ea5d91a72aecfde7107dd0c807 (patch) | |
tree | 7fcf5a6644d51ce1ab459fe2bd2888aea39c7b51 /ctrl/facemgr/src/interface.c | |
parent | 9793bd7849975399ca103480ab946669888080a8 (diff) | |
parent | 29bb779084d76fb31e1b5dfbf54995918d02fc0e (diff) |
Merge "[HICN-372] Code clean up"
Diffstat (limited to 'ctrl/facemgr/src/interface.c')
-rw-r--r-- | ctrl/facemgr/src/interface.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ctrl/facemgr/src/interface.c b/ctrl/facemgr/src/interface.c index 72a78ef56..d592bf04c 100644 --- a/ctrl/facemgr/src/interface.c +++ b/ctrl/facemgr/src/interface.c @@ -53,19 +53,21 @@ interface_unregister_all() int n = interface_ops_map_get_key_array(interface_ops_map, &ops_name_array); if (n < 0) { ERROR("[interface_unregister_all] Could not get interface ops array"); - ret = -1; - } else { - for (unsigned i = 0; i < n; i++) { - const char * ops_name = ops_name_array[i]; - if (interface_ops_map_remove(interface_ops_map, ops_name, NULL) < 0) { - ERROR("[interface_unregister_all] Could not remove %s from interface ops map", ops_name); - ret = -1; - } + return -1; + } + + for (unsigned i = 0; i < n; i++) { + const char * ops_name = ops_name_array[i]; + if (interface_ops_map_remove(interface_ops_map, ops_name, NULL) < 0) { + ERROR("[interface_unregister_all] Could not remove %s from interface ops map", ops_name); + ret = -1; } - free(ops_name_array); } + free(ops_name_array); + interface_ops_map_free(interface_ops_map); interface_ops_map = NULL; + return ret; } |