Skip to content

Commit 32a51d9

Browse files
HaavardReicvinayak
authored andcommitted
[nrf fromlist] 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. Upstream PR: zephyrproject-rtos/zephyr#64065 Signed-off-by: Håvard Reierstad <[email protected]> (cherry picked from commit 24edc9d)
1 parent 979569b commit 32a51d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/bluetooth/mesh/access.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ int bt_mesh_model_extend(struct bt_mesh_model *extending_mod, struct bt_mesh_mod
16781678
/* Check if a's list contains b */
16791679
for (it = a; (it != NULL) && (it->next != a); it = it->next) {
16801680
if (it == b) {
1681-
return 0;
1681+
goto register_extension;
16821682
}
16831683
}
16841684

@@ -1695,7 +1695,7 @@ int bt_mesh_model_extend(struct bt_mesh_model *extending_mod, struct bt_mesh_mod
16951695
a->next = b;
16961696
}
16971697

1698-
1698+
register_extension:
16991699
if (IS_ENABLED(CONFIG_BT_MESH_COMP_PAGE_1)) {
17001700
return mod_rel_register(base_mod, extending_mod, RELATION_TYPE_EXT);
17011701
}

0 commit comments

Comments
 (0)