Home
last modified time | relevance | path

Searched hist:"6 aea7624a01cc39c19d4237c4b108659270a61c5" (Results 1 – 1 of 1) sorted by relevance

/rk3399_ARM-atf/drivers/arm/gic/v3/
H A Dgic600_multichip_private.h6aea7624a01cc39c19d4237c4b108659270a61c5 Thu Sep 29 10:03:50 UTC 2022 Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com> fix(gicv3/multichip): fix overflow caused by left shift

When spi_id_max is 5119, the expression `(spi_id_max - 4096U + 1U >> 5)`
evaluates to 32 leading to undefined behavior when using it to left
shift 1. Fix this undefined behavior.

Reported-by coverity scan:
https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.org/thread/RMB4U7COL6IONZWEGF2FWXOQ6FPDIT4U/

```
large_shift: In expression 1 << (spi_id_max - 4096U + 1U >> 5), left
shifting by more than 31 bits has undefined behavior. The shift
amount, spi_id_max - 4096U + 1U >> 5, is as much as 32.
```

Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I5e77a78b81a6d0367875e7ea432a82b6ba0e587c