Skip to content

Commit

Permalink
Fix null check in cpu_group_find_highest_id.
Browse files Browse the repository at this point in the history
Fixes #251
  • Loading branch information
flaviojs committed Oct 6, 2024
1 parent 119d171 commit 8460a78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int cpu_group_find_highest_id(cpu_group_t *group,u_int *highest_id)
cpu_gen_t *cpu;
u_int max_id = 0;

if (!group || group->cpu_list)
if (!group || !group->cpu_list)
return(-1);

for(cpu=group->cpu_list;cpu;cpu=cpu->next)
Expand Down
2 changes: 1 addition & 1 deletion unstable/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int cpu_group_find_highest_id(cpu_group_t *group,u_int *highest_id)
cpu_gen_t *cpu;
u_int max_id = 0;

if (!group || group->cpu_list)
if (!group || !group->cpu_list)
return(-1);

for(cpu=group->cpu_list;cpu;cpu=cpu->next)
Expand Down

0 comments on commit 8460a78

Please sign in to comment.