diff options
author | Mate Kukri <km@mkukri.xyz> | 2024-08-01 19:40:52 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2024-08-03 14:00:26 +0000 |
commit | ac9ffb94324e45ee19e9dcbf2847744992ed572f (patch) | |
tree | 4caa1253c163f1f920ab9612d0292d5b2613b6d4 /src/commonlib/bsd | |
parent | b256e6303c13abc13825bf2d3fb2fbc2ed1fd788 (diff) |
mb/dell/optiplex_9020: Fix UB in package power calculation
Fix potential undefined behaviour in the `get_pkg_power()` function:
- If `rapl_power_unit == 0`, `pkg_power_info / rapl_power_unit` is
invalid
- If `rapl_power_unit > 7`, the result of the shift doesn't fit into a
`uint8_t`
Signed-off-by: Mate Kukri <km@mkukri.xyz>
Change-Id: I48ef59c4fbeb0a55675ac24da31e6e0b194cb58d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83736
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'src/commonlib/bsd')
0 files changed, 0 insertions, 0 deletions