From 73e1cccdbb616641a8c585e2495522194461bb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Narajowski?= Date: Mon, 22 Jun 2020 13:29:31 +0200 Subject: [PATCH] mesh: Fix Vendor Model Subscription Get procedure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Invalid argument was passed to bt_mesh_model_tree_walk. Signed-off-by: MichaƂ Narajowski --- subsys/bluetooth/mesh/cfg_srv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/cfg_srv.c b/subsys/bluetooth/mesh/cfg_srv.c index 5be9a37da80..95b8bf494ee 100644 --- a/subsys/bluetooth/mesh/cfg_srv.c +++ b/subsys/bluetooth/mesh/cfg_srv.c @@ -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)) {