Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 311154e77 -> 5b09171d2
nimble/ll: Fix for compiler warning This patch solves issue which is visible when building with -Og option. ble_ll_conn.c:2365:18: error: 'init_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized] Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/ed8564d9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/ed8564d9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/ed8564d9 Branch: refs/heads/develop Commit: ed8564d9b0a91bd1ae0fa3157f3df274eaf2bf78 Parents: c10dcba Author: Åukasz Rymanowski <[email protected]> Authored: Wed Feb 1 15:25:50 2017 +0100 Committer: Åukasz Rymanowski <[email protected]> Committed: Wed Feb 1 15:50:05 2017 +0100 ---------------------------------------------------------------------- net/nimble/controller/src/ble_ll_conn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ed8564d9/net/nimble/controller/src/ble_ll_conn.c ---------------------------------------------------------------------- diff --git a/net/nimble/controller/src/ble_ll_conn.c b/net/nimble/controller/src/ble_ll_conn.c index 313e4fe..33a54f3 100644 --- a/net/nimble/controller/src/ble_ll_conn.c +++ b/net/nimble/controller/src/ble_ll_conn.c @@ -2251,7 +2251,7 @@ ble_ll_init_rx_isr_end(uint8_t *rxbuf, uint8_t crcok, uint8_t peer_addr_type; uint8_t *adv_addr; uint8_t *peer; - uint8_t *init_addr; + uint8_t *init_addr = NULL; uint8_t pyld_len; uint8_t inita_is_rpa; uint32_t endtime; @@ -2360,7 +2360,7 @@ ble_ll_init_rx_isr_end(uint8_t *rxbuf, uint8_t crcok, * If the inita is a RPA, we must see if it resolves based on the * identity address of the resolved ADVA. */ - if (inita_is_rpa) { + if (init_addr && inita_is_rpa) { if ((index < 0) || !ble_ll_resolv_rpa(init_addr, g_ble_ll_resolv_list[index].rl_local_irk)) {
