fsm: id: properly set name in case of NULL id
Since alloc relies on osmo_fsm_inst_update_id() to set the name, never skip
that.
In osmo_fsm_inst_alloc(), we allow passing a NULL id, and in
osmo_fsm_inst_update_id(), we set the name without id if id is NULL.
Change-Id: I6d6b09a811b82770818f19b189a57d9fc4a8133b
diff --git a/src/fsm.c b/src/fsm.c
index 88de011..9bbf870 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -263,11 +263,9 @@
fi->log_level = log_level;
osmo_timer_setup(&fi->timer, fsm_tmr_cb, fi);
- if (id) {
- if (osmo_fsm_inst_update_id(fi, id) < 0) {
- talloc_free(fi);
- return NULL;
- }
+ if (osmo_fsm_inst_update_id(fi, id) < 0) {
+ talloc_free(fi);
+ return NULL;
}
INIT_LLIST_HEAD(&fi->proc.children);