Skip to content

Commit 944b974

Browse files
authored
[DM][PIC] Fix #10998 (#11024)
* [DM/PIC] Fixup SMP CPU mask list when CPU < 4 * [DM][PIC] Fix #10998 The size of cpumask is `RT_CPUS_NR`, memset force to space will overflow in stack. Signed-off-by: GuEe-GUI <2991707448@qq.com>
1 parent b949618 commit 944b974

File tree

1 file changed

+4
-0
lines changed
  • components/drivers/pic

1 file changed

+4
-0
lines changed

components/drivers/pic/pic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,10 @@ static int list_irq(int argc, char**argv)
12591259
rt_memset(&cpumask[RT_CPUS_NR], ' ', 4 - RT_CPUS_NR);
12601260
}
12611261
rt_kputs(cpumask);
1262+
if (RT_CPUS_NR < 4)
1263+
{
1264+
rt_kprintf("%-*.s", 4 - RT_CPUS_NR, " ");
1265+
}
12621266
#endif
12631267

12641268
#ifdef RT_USING_INTERRUPT_INFO

0 commit comments

Comments
 (0)