]> git.baikalelectronics.ru Git - kernel.git/commit
clockevent: sun4i: Fix race condition in the probe code
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 18 Nov 2014 22:59:33 +0000 (23:59 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 19 Nov 2014 09:43:51 +0000 (10:43 +0100)
commit95dd8b160243338ccbf44d44c9b89ae00f960662
tree95cf8a083e1799d3fabbf354ed40ac4bc599d19b
parent792b0ea53725efeaaf9c1c077c4cf1fc67773b74
clockevent: sun4i: Fix race condition in the probe code

The interrupts were activated and the handler registered before the clockevent
was registered in the probe function.

The interrupt handler, however, was making the assumption that the clockevent
device was registered.

That could cause a null pointer dereference if the timer interrupt was firing
during this narrow window.

Fix that by moving the clockevent registration before the interrupt is enabled.

Reported-by: Roman Byshko <rbyshko@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/sun4i_timer.c