drivers: intc_ioapic: Fix Out of Bounds shift

Hexadecimal integer literals are signed if they can fit into a signed int,
which causes undefined behavior.

This happens here because 0xFF can fit into a signed int and then gets
left-shifted by 24, undefined behavior for signed integers.

Signed-off-by: Daniel Hajjar <daniel.hajjar16@gmail.com>
This commit is contained in:
Daniel Hajjar
2025-03-20 17:49:50 +01:00
committed by Benjamin Cabé
parent a65a16424b
commit a4e139b9f8

View File

@@ -84,7 +84,7 @@ DEVICE_MMIO_TOPLEVEL_STATIC(ioapic_regs, DT_DRV_INST(0));
* In either case, regardless how many CPUs in the system, 0xff implies that
* it's intended to deliver to all possible 8 local APICs.
*/
#define DEFAULT_RTE_DEST (0xFF << 24)
#define DEFAULT_RTE_DEST (0xFFU << 24)
static __pinned_bss uint32_t ioapic_rtes;