Skip to content
Commit d4a19eb3 authored by Matthias Brugger's avatar Matthias Brugger Committed by Daniel Lezcano
Browse files

clocksource: mtk: Fix race conditions in probe code



We have two race conditions in the probe code which could lead to a null
pointer dereference in the interrupt handler.

The interrupt handler accesses the clockevent device, which may not yet be
registered.

First race condition happens when the interrupt handler gets registered before
the interrupts get disabled. The second race condition happens when the
interrupts get enabled, but the clockevent device is not yet registered.

Fix that by disabling the interrupts before we register the interrupt and enable
the interrupts after the clockevent device got registered.

Reported-by: default avatarGongbae Park <yongbae2@gmail.com>
Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent a8b1b9fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment