From 7d4b6c63069b02918862d7f9ea363867980172b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Battrel?= Date: Wed, 17 Apr 2024 06:54:49 +0200 Subject: [PATCH] Bluetooth: Controller: Fix UBSan error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UBSan was showing the following error: ``` runtime error: left shift of 137 by 24 places cannot be represented in type 'int' ``` Cast the value to `uint32_t` to make UBSan happy. Signed-off-by: Théo Battrel --- subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index 71b8f3c4c79..9d5357fba8b 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -390,7 +390,7 @@ void radio_aa_set(const uint8_t *aa) NRF_RADIO->RXADDRESSES = ((RADIO_RXADDRESSES_ADDR0_Enabled) << RADIO_RXADDRESSES_ADDR0_Pos); NRF_RADIO->PREFIX0 = aa[3]; - NRF_RADIO->BASE0 = (aa[2] << 24) | (aa[1] << 16) | (aa[0] << 8); + NRF_RADIO->BASE0 = (((uint32_t) aa[2]) << 24) | (aa[1] << 16) | (aa[0] << 8); } void radio_pkt_configure(uint8_t bits_len, uint8_t max_len, uint8_t flags)