Don't overwrite existing data in osmo_ss7_instance_find_or_create()
If we actually found an instance for the specified ID, return it fast and don't (re)initialize all linked list heads, etc. Change-Id: I91b6aabdb873ed8dd103918ee5e40b7ad3946735
This commit is contained in:
parent
993da0b4c2
commit
146bb5cebd
|
@ -315,8 +315,10 @@ osmo_ss7_instance_find_or_create(void *ctx, uint32_t id)
|
|||
OSMO_ASSERT(ss7_initialized);
|
||||
|
||||
inst = osmo_ss7_instance_find(id);
|
||||
if (!inst)
|
||||
inst = talloc_zero(ctx, struct osmo_ss7_instance);
|
||||
if (inst)
|
||||
return inst;
|
||||
|
||||
inst = talloc_zero(ctx, struct osmo_ss7_instance);
|
||||
if (!inst)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue