From 84e381e0a7d543e2ef9a5a10e2c418fe16093307 Mon Sep 17 00:00:00 2001 From: Stephen Pliaskin Date: Fri, 14 Feb 2020 15:20:29 +0300 Subject: [PATCH] Bluetooth: Mesh: typo in condition in comp_add_elem of cfg_srv Vendor model IDs take up four (not two) bytes in the composition Fixes #22822 Signed-off-by: Stephen Pliaskin --- subsys/bluetooth/mesh/cfg_srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/mesh/cfg_srv.c b/subsys/bluetooth/mesh/cfg_srv.c index 20365f0194b..884906695b5 100644 --- a/subsys/bluetooth/mesh/cfg_srv.c +++ b/subsys/bluetooth/mesh/cfg_srv.c @@ -50,7 +50,7 @@ static int comp_add_elem(struct net_buf_simple *buf, struct bt_mesh_elem *elem, int i; if (net_buf_simple_tailroom(buf) < - 4 + (elem->model_count * 2U) + (elem->vnd_model_count * 2U)) { + 4 + (elem->model_count * 2U) + (elem->vnd_model_count * 4U)) { BT_ERR("Too large device composition"); return -E2BIG; }