Skip to content

Commit

Permalink
Merge pull request #262 from flaviojs/fix-null-check-cpu_group_find_h…
Browse files Browse the repository at this point in the history
…ighest_id

Fix null check in cpu_group_find_highest_id.
  • Loading branch information
grossmj authored Oct 6, 2024
2 parents 119d171 + 8460a78 commit f351cef
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 f351cef

Please sign in to comment.