aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/facemgr/src/interface.c
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-10-31 17:02:17 +0100
committerJordan Augé <jordan.auge+fdio@cisco.com>2019-10-31 17:12:00 +0100
commit29bb779084d76fb31e1b5dfbf54995918d02fc0e (patch)
tree3196a6755573609a3e6125d8792da8bb4e8de8c4 /ctrl/facemgr/src/interface.c
parent5268f318730bd8f3ffaf62e5d6bfae64eb17cb90 (diff)
[HICN-372] Code clean up
Change-Id: Ic0ce2d01a05c2724eeaf91f76aafa2facedcbaf3 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'ctrl/facemgr/src/interface.c')
-rw-r--r--ctrl/facemgr/src/interface.c20
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;
}