From aa832ee2511693114db417714183a4ac37272e9b Mon Sep 17 00:00:00 2001 From: Pankaj Raghav Date: Thu, 27 Jan 2022 16:33:28 +0530 Subject: [PATCH] Kernel: Add conditional call to disable_irq in IRQHandler constructor There is no use in calling disable_irq function in the IRQHandler constructor if irq was not registered before. So add a condition where we call disable_irq only if the irq was registered before. --- Kernel/Interrupts/IRQHandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Kernel/Interrupts/IRQHandler.cpp b/Kernel/Interrupts/IRQHandler.cpp index da98034a59..ccc58dd5e8 100644 --- a/Kernel/Interrupts/IRQHandler.cpp +++ b/Kernel/Interrupts/IRQHandler.cpp @@ -15,7 +15,8 @@ IRQHandler::IRQHandler(u8 irq) : GenericInterruptHandler(irq) , m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq)) { - disable_irq(); + if (is_registered()) + disable_irq(); } IRQHandler::~IRQHandler()