From 69ff0f310e9e02cf3208d5250282b06a88e7a3f3 Mon Sep 17 00:00:00 2001 From: Morten Priess Date: Fri, 16 Aug 2019 15:46:14 +0200 Subject: [PATCH] bluetooth: controller: Fix for uninitialized data compile error Due to conditional compile path ending in LL_ASSERT(0), the compiler sees code following the assert as using uninitialized variables. Signed-off-by: Morten Priess --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_master.c | 1 + subsys/bluetooth/controller/ll_sw/nordic/lll/lll_slave.c | 1 + 2 files changed, 2 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_master.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_master.c index 14a6c84847e..61856b9772d 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_master.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_master.c @@ -120,6 +120,7 @@ static int prepare_cb(struct lll_prepare_param *prepare_param) &lll->data_chan_map[0], lll->data_chan_count); #else /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ + data_chan_use = 0; LL_ASSERT(0); #endif /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ } else { diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_slave.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_slave.c index f4c260a46a2..461395257bb 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_slave.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_slave.c @@ -131,6 +131,7 @@ static int prepare_cb(struct lll_prepare_param *prepare_param) &lll->data_chan_map[0], lll->data_chan_count); #else /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ + data_chan_use = 0; LL_ASSERT(0); #endif /* !CONFIG_BT_CTLR_CHAN_SEL_2 */ } else {