Bluetooth: mesh: update model extension
Adds a goto statement to ensure that model extensions are registered in Composition Data Page 1 if it is enabled. Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
This commit is contained in:
parent
7e852d1708
commit
765b31979f
1 changed files with 2 additions and 2 deletions
|
@ -1678,7 +1678,7 @@ int bt_mesh_model_extend(struct bt_mesh_model *extending_mod, struct bt_mesh_mod
|
|||
/* Check if a's list contains b */
|
||||
for (it = a; (it != NULL) && (it->next != a); it = it->next) {
|
||||
if (it == b) {
|
||||
return 0;
|
||||
goto register_extension;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1695,7 +1695,7 @@ int bt_mesh_model_extend(struct bt_mesh_model *extending_mod, struct bt_mesh_mod
|
|||
a->next = b;
|
||||
}
|
||||
|
||||
|
||||
register_extension:
|
||||
if (IS_ENABLED(CONFIG_BT_MESH_COMP_PAGE_1)) {
|
||||
return mod_rel_register(base_mod, extending_mod, RELATION_TYPE_EXT);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue