summaryrefslogtreecommitdiff
path: root/Kernel/Interrupts/IRQHandler.cpp
diff options
context:
space:
mode:
authorPankaj Raghav <pankydev8@gmail.com>2022-01-27 16:33:28 +0530
committerAndreas Kling <kling@serenityos.org>2022-02-02 18:26:59 +0100
commitaa832ee2511693114db417714183a4ac37272e9b (patch)
treee5a066dbb62da056a725ec51050214dc14733a3a /Kernel/Interrupts/IRQHandler.cpp
parente5a6d12ff80aef5a34c3081f153b958dca2ea841 (diff)
downloadserenity-aa832ee2511693114db417714183a4ac37272e9b.zip
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.
Diffstat (limited to 'Kernel/Interrupts/IRQHandler.cpp')
-rw-r--r--Kernel/Interrupts/IRQHandler.cpp3
1 files changed, 2 insertions, 1 deletions
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()