Bluetooth: Mesh: Fixes wrong prov pointer clear

The structure pointer was wrongly cleared before,
`bearer` and `role` in `bt_mesh_prov_link` structure
resulting in illegal pointer access.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
This commit is contained in:
Lingao Meng 2020-11-13 19:55:34 -08:00 committed by Johan Hedberg
commit 109d6d4d8c
2 changed files with 6 additions and 5 deletions

View file

@ -59,6 +59,7 @@ int bt_mesh_prov_reset_state(void (*func)(const uint8_t key[64]))
bt_mesh_attention(NULL, 0);
}
atomic_clear(bt_mesh_prov_link.flags);
(void)memset((uint8_t *)&bt_mesh_prov_link + offset, 0,
sizeof(bt_mesh_prov_link) - offset);