mesh: Fix Vendor Model Subscription Get procedure

Invalid argument was passed to bt_mesh_model_tree_walk.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
This commit is contained in:
Michał Narajowski 2020-06-22 13:29:31 +02:00 committed by Johan Hedberg
commit 73e1cccdbb

View file

@ -1698,6 +1698,7 @@ static void mod_sub_get_vnd(struct bt_mesh_model *model,
struct net_buf_simple *buf)
{
NET_BUF_SIMPLE_DEFINE(msg, BT_MESH_TX_SDU_MAX);
struct mod_sub_list_ctx visit_ctx;
struct bt_mesh_model *mod;
struct bt_mesh_elem *elem;
uint16_t company, addr, id;
@ -1739,8 +1740,10 @@ static void mod_sub_get_vnd(struct bt_mesh_model *model,
net_buf_simple_add_le16(&msg, company);
net_buf_simple_add_le16(&msg, id);
visit_ctx.msg = &msg;
visit_ctx.elem_idx = mod->elem_idx;
bt_mesh_model_tree_walk(bt_mesh_model_root(mod), mod_sub_list_visitor,
&msg);
&visit_ctx);
send_list:
if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) {