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.
This commit is contained in:
Pankaj Raghav 2022-01-27 16:33:28 +05:30 committed by Andreas Kling
commit aa832ee251
Notes: sideshowbarker 2024-07-17 19:52:55 +09:00

View file

@ -15,7 +15,8 @@ IRQHandler::IRQHandler(u8 irq)
: GenericInterruptHandler(irq) : GenericInterruptHandler(irq)
, m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq)) , m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq))
{ {
disable_irq(); if (is_registered())
disable_irq();
} }
IRQHandler::~IRQHandler() IRQHandler::~IRQHandler()