summaryrefslogtreecommitdiff
path: root/lib/utils/timer
diff options
context:
space:
mode:
authorAtish Patra <[email protected]>2022-07-20 14:50:32 -0700
committerAnup Patel <[email protected]>2022-07-30 11:09:18 +0530
commit1545afd342f2e22aaf91c4760dc5706965ec7fdf (patch)
treeaffabfba9fc05a9814ddeedba94abe8eaec31795 /lib/utils/timer
parent88b790f1291618274f94b6d5110ed09e20148bb2 (diff)
lib: sbi: Fix counter index sanity check
The current implementation computes the possible counter range by doing a left shift of counter base. However, this may overflow depending on the counter base value. In case of overflow, the highest counter id may be computed incorrectly. As per the SBI specification, the respective function should return an error if any of the counter is not valid. Fix the counter index check by avoiding left shifting while doing the sanity checks. Without the shift, the implementation just iterates over the counter mask and computes the correct counter index by adding the base to it. Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Atish Patra <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/timer')
0 files changed, 0 insertions, 0 deletions