summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGUI <[email protected]>2025-12-09 14:33:31 +0800
committerGitHub <[email protected]>2025-12-09 14:33:31 +0800
commit944b974c1aa08b750f52364a86cae9d44ea3281d (patch)
tree77a163627eeb017acd2de7a830768d5b0735c6eb
parentb949618f205d442b061f6acb3c4f1329b44ff02f (diff)
[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 <[email protected]>
-rw-r--r--components/drivers/pic/pic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/drivers/pic/pic.c b/components/drivers/pic/pic.c
index 4194692fd1..423846c6e7 100644
--- a/components/drivers/pic/pic.c
+++ b/components/drivers/pic/pic.c
@@ -1259,6 +1259,10 @@ static int list_irq(int argc, char**argv)
rt_memset(&cpumask[RT_CPUS_NR], ' ', 4 - RT_CPUS_NR);
}
rt_kputs(cpumask);
+ if (RT_CPUS_NR < 4)
+ {
+ rt_kprintf("%-*.s", 4 - RT_CPUS_NR, " ");
+ }
#endif
#ifdef RT_USING_INTERRUPT_INFO