diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-07-14 13:30:46 -0600 |
---|---|---|
committer | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-07-22 21:06:56 +0000 |
commit | 7777e1c30b5c9d47388627c080ff86a4e043ec7e (patch) | |
tree | 08a66a6484f3267dd90a27b6c6b66efd24eae447 /src/drivers | |
parent | 60c619f6a3c0fbe2f53095a029cd07a11f5cf5e1 (diff) |
ec/google/chromeec: Fix Coverity Scan error (BAD_SHIFT)
A recent Coverity scan found an issue with the way the
EC_HOST_EVENT_MASK macro was being used. It was being passed values
between 0 and 63, but since it is doing basically (1ULL << (value - 1)),
this caused a shift of -1 when `i` is 0 and also doesn't reach the 63rd
bit of the mask. This is fixed by incrementing the start and end
conditions of the loop by 1, so the event mask ranges from bits 0 to 63,
instead of -1 to 62.
Found-by: Coverity CID 1430218
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I6a7cfa64545f3d313de24407f0a91b48368f2a8a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43460
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/drivers')
0 files changed, 0 insertions, 0 deletions