Skip to content
Commit 5f63c9d9 authored by Andy Ross's avatar Andy Ross Committed by Carles Cufí
Browse files

drivers/timer: Clamp after tick adjustment, not before



Some early tickless drivers had a common pattern where they would
compute a tick maximum for the request (i.e. the maximum the hardware
counter can handle) but apply it only on the input tick value and not
on the adjusted final value, opening up the overflow condition it was
supposed to have prevented.

Fixes #20939 (Strictly it fixes the specific pattern that was
discovered in that bug.  It's not impossible that other drivers with
alternative implementations have a similar issue, though they look OK
to me via a quick audit).

Signed-off-by: default avatarAndy Ross <andrew.j.ross@intel.com>
parent 44bbdd0a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment