Skip to content

Commit 855ecdb

Browse files
Thalleynordicjm
authored andcommitted
[nrf fromtree] Bluetooth: Controller: Fix casting in radio_aa_set for BASE0
We have previously fixed an issue with shifting and assigning the value without a cast, but coverity is still complaining about aa[1] and aa[0] with: "Casting narrower unsigned aa[1] to wider signed type int effectively tests its lower bound." Using the common function, sys_get_le24, should fix this issue. Signed-off-by: Emil Gydesen <[email protected]> (cherry picked from commit 9fca7ee) Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent c368cd7 commit 855ecdb

File tree

1 file changed

+1
-1
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio

1 file changed

+1
-1
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ void radio_aa_set(const uint8_t *aa)
405405
NRF_RADIO->RXADDRESSES =
406406
((RADIO_RXADDRESSES_ADDR0_Enabled) << RADIO_RXADDRESSES_ADDR0_Pos);
407407
NRF_RADIO->PREFIX0 = aa[3];
408-
NRF_RADIO->BASE0 = (((uint32_t) aa[2]) << 24) | (aa[1] << 16) | (aa[0] << 8);
408+
NRF_RADIO->BASE0 = sys_get_le24(aa) << 8;
409409
}
410410

411411
void radio_pkt_configure(uint8_t bits_len, uint8_t max_len, uint8_t flags)

0 commit comments

Comments
 (0)