Skip to content

Commit

Permalink
add missing check, ops
Browse files Browse the repository at this point in the history
  • Loading branch information
kylon authored and FlyGoat committed Jan 25, 2025
1 parent 6f31b0c commit 74545b1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,9 @@ EXP float CALL get_slow_time(ryzen_access ry) {
}

EXP float CALL get_core_power(ryzen_access ry, uint32_t core) {
if (core > 7)
return NAN;

u32 baseOffset;

switch (ry->table_ver) {
Expand Down Expand Up @@ -2107,6 +2110,9 @@ EXP float CALL get_core_power(ryzen_access ry, uint32_t core) {
}

EXP float CALL get_core_volt(ryzen_access ry, uint32_t core) {
if (core > 7)
return NAN;

u32 baseOffset;

switch (ry->table_ver) {
Expand Down Expand Up @@ -2139,6 +2145,9 @@ EXP float CALL get_core_volt(ryzen_access ry, uint32_t core) {
}

EXP float CALL get_core_temp(ryzen_access ry, uint32_t core) {
if (core > 7)
return NAN;

u32 baseOffset;

switch (ry->table_ver) {
Expand Down Expand Up @@ -2171,6 +2180,9 @@ EXP float CALL get_core_temp(ryzen_access ry, uint32_t core) {
}

EXP float CALL get_core_clk(ryzen_access ry, uint32_t core) {
if (core > 7)
return NAN;

u32 baseOffset;

switch (ry->table_ver) {
Expand Down

0 comments on commit 74545b1

Please sign in to comment.