Skip to content

Commit

Permalink
Merge pull request #171 from flaviojs/fix-negative-index-tsg_unbind_cpu
Browse files Browse the repository at this point in the history
Fix negative index in tsg_unbind_cpu
  • Loading branch information
grossmj authored Mar 13, 2024
2 parents 37eb853 + 205a5dd commit 8b6cd41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unstable/tcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ int tsg_bind_cpu(cpu_gen_t *cpu)
/* Unbind a CPU from a TSG - release all resources used */
int tsg_unbind_cpu(cpu_gen_t *cpu)
{
tsg_t *tsg = tsg_array[cpu->tsg];
tsg_t *tsg;
cpu_tb_t *tb,*next;

if (cpu->tsg == -1)
Expand All @@ -290,6 +290,7 @@ int tsg_unbind_cpu(cpu_gen_t *cpu)
cpu->tb_list = NULL;
cpu->tb_free_list = NULL;

tsg = tsg_array[cpu->tsg];
TSG_LOCK(tsg);
M_LIST_REMOVE(cpu,tsg);
TSG_UNLOCK(tsg);
Expand Down

0 comments on commit 8b6cd41

Please sign in to comment.