Bluetooth: Mesh: Fix provisioning buffer initialization
When PB-GATT support has been enabled the provisioning code "borrows" the buffer from the proxy code. However, the way that initialization was happening the proxy buffers were initialized only after provisioning initialization, resulting in a corrupted buffer with buf->data pointing to NULL. Reorder the initialization calls so that proxy is done first and provisioning only after it. Fixes #22207 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
88db84b89b
commit
637582dfae
1 changed files with 4 additions and 4 deletions
|
@ -304,6 +304,10 @@ int bt_mesh_init(const struct bt_mesh_prov *prov,
|
|||
return err;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_MESH_PROXY)) {
|
||||
bt_mesh_proxy_init();
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_MESH_PROV)) {
|
||||
err = bt_mesh_prov_init(prov);
|
||||
if (err) {
|
||||
|
@ -316,10 +320,6 @@ int bt_mesh_init(const struct bt_mesh_prov *prov,
|
|||
bt_mesh_beacon_init();
|
||||
bt_mesh_adv_init();
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_MESH_PROXY)) {
|
||||
bt_mesh_proxy_init();
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
|
||||
bt_mesh_settings_init();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue