From 25dca96e0eb0a42c27d7e1bea83d45353b6bd880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Thu, 3 Sep 2020 11:13:55 +0200 Subject: [PATCH] mesh/cfg_srv.c: Fix Vendor Model Subscription Get procedure Invalid argument was passed to bt_mesh_model_tree_walk. --- nimble/host/mesh/src/cfg_srv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nimble/host/mesh/src/cfg_srv.c b/nimble/host/mesh/src/cfg_srv.c index 57aac90a3..5cac1ad29 100644 --- a/nimble/host/mesh/src/cfg_srv.c +++ b/nimble/host/mesh/src/cfg_srv.c @@ -1748,6 +1748,7 @@ static void mod_sub_get_vnd(struct bt_mesh_model *model, struct os_mbuf *buf) { struct os_mbuf *msg = NET_BUF_SIMPLE(BT_MESH_TX_SDU_MAX); + struct mod_sub_list_ctx visit_ctx; struct bt_mesh_model *mod; struct bt_mesh_elem *elem; u16_t company, addr, id; @@ -1789,8 +1790,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)) {