Commit 1b0a2100 authored by Maxime Ripard's avatar Maxime Ripard Committed by Jiri Slaby
Browse files

clockevent: sun4i: Fix race condition in the probe code



commit 6bab4a8a upstream.

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: default avatarRoman Byshko <rbyshko@gmail.com>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 5545f8b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment