From a6ce33d7eabd6057899c03ba32f354833701ffa1 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 30 Oct 2017 15:00:04 +0200 Subject: [PATCH] Bluetooth: Mesh: Cfg: Only update friend state if supported If Friend support is not available we should not modify the value of cfg->frnd. Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/mesh/cfg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/mesh/cfg.c b/subsys/bluetooth/host/mesh/cfg.c index 0730557a95e..509db7caa8e 100644 --- a/subsys/bluetooth/host/mesh/cfg.c +++ b/subsys/bluetooth/host/mesh/cfg.c @@ -2473,7 +2473,9 @@ static void friend_set(struct bt_mesh_model *model, goto send_status; } - cfg->frnd = buf->data[0]; + if (IS_ENABLED(CONFIG_BT_MESH_FRIEND)) { + cfg->frnd = buf->data[0]; + } sub = bt_mesh_subnet_get(cfg->hb_pub.net_idx); if ((cfg->hb_pub.feat & BT_MESH_FEAT_FRIEND) && sub) {