Skip to content

Commit

Permalink
Merge pull request #222 from flaviojs/fix-null-dereference-ppc32_get_…
Browse files Browse the repository at this point in the history
…idling_pc

Fix NULL dereference in ppc32_get_idling_pc.
  • Loading branch information
grossmj authored Apr 3, 2024
2 parents e8c4e38 + 47041af commit d79f47e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stable/ppc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ int ppc32_get_idling_pc(cpu_gen_t *cpu)
printf("\nPlease wait while gathering statistics...\n");

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

/* Disable IRQ */
pcpu->irq_disable = TRUE;
Expand Down
4 changes: 4 additions & 0 deletions unstable/ppc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ int ppc32_get_idling_pc(cpu_gen_t *cpu)
printf("\nPlease wait while gathering statistics...\n");

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

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

0 comments on commit d79f47e

Please sign in to comment.