From 71f76a1f42958ca6dca26669daf41a568d694c18 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 31 Mar 2018 16:30:25 +0200 Subject: 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 --- src/fsm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/fsm.c') diff --git a/src/fsm.c b/src/fsm.c index 88de0116..9bbf870e 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -263,11 +263,9 @@ struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void 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); -- cgit v1.2.3