Skip to content

Commit

Permalink
Merge pull request #221 from flaviojs/fix-null-dereference-mips64_get…
Browse files Browse the repository at this point in the history
…_idling_pc

Fix NULL dereference in mips64_get_idling_pc.
  • Loading branch information
grossmj authored Apr 3, 2024
2 parents 5135a10 + 20166f8 commit e8c4e38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions unstable/mips64.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ int mips64_get_idling_pc(cpu_gen_t *cpu)
printf("\nPlease wait while gathering statistics...\n");

pc_hash = calloc(IDLE_HASH_SIZE,sizeof(struct mips64_idle_pc_hash *));
if (pc_hash == NULL) {
printf("Out of memory.");
return(-1);
}

/* Disable IRQ */
mcpu->irq_disable = TRUE;
Expand Down

0 comments on commit e8c4e38

Please sign in to comment.