From 4c6f75d13cff5e689e7ebaa787c9a8e346551771 Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 21 Aug 2024 21:51:18 +0800 Subject: [PATCH] sched/irq: correct critical section to spin lock Regression by: | commit 2ee8aa6f2b4ae5384f7dc984f467702d5f3fbf40 | Author: hujun5 | Date: Thu Jan 11 11:27:31 2024 +0800 | | sched: we use spin_lock_irqsave replace enter_critical_section to protect g_irqvector | | enter_critical_section may be called before os initialized | | Signed-off-by: hujun5 Signed-off-by: chao an --- sched/irq/irq_attach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sched/irq/irq_attach.c b/sched/irq/irq_attach.c index 83249c4a2e..08f19fb222 100644 --- a/sched/irq/irq_attach.c +++ b/sched/irq/irq_attach.c @@ -106,7 +106,7 @@ int irq_attach(int irq, xcpt_t isr, FAR void *arg) if (is_irqchain(ndx, isr)) { ret = irqchain_attach(ndx, isr, arg); - leave_critical_section(flags); + spin_unlock_irqrestore(NULL, flags); return ret; } #endif