ctrl: Improve error handling if controlif setup fails
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index 1a24a24..6bab461 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -304,9 +304,17 @@
return 0;
}
-void bsc_ctrl_cmds_install()
+int bsc_ctrl_cmds_install()
{
- ctrl_cmd_install(CTRL_NODE_NET, &cmd_net_loc);
- ctrl_cmd_install(CTRL_NODE_NET, &cmd_net_rf_lock);
- ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_rf_lock);
+ int rc;
+
+ rc = ctrl_cmd_install(CTRL_NODE_NET, &cmd_net_loc);
+ if (rc)
+ goto end;
+ rc = ctrl_cmd_install(CTRL_NODE_NET, &cmd_net_rf_lock);
+ if (rc)
+ goto end;
+ rc = ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_rf_lock);
+end:
+ return rc;
}