diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-02-25 16:37:46 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-25 16:37:46 +0900 |
commit | da64c2a8dee66ca03f4f3e15d84be7bedf73db3d (patch) | |
tree | 8de9d4de358447a80f731a49a689c84bca42abf5 /drivers/clocksource/sh_mtu2.c | |
parent | 29463c28a553e1959ec45cc8ad9d2eb434663cdf (diff) |
clocksource: Fix up a registration/IRQ race in the sh drivers.
All of the SH clocksource drivers follow the scheme that the IRQ is setup
prior to registering the clockevent. The interrupt handler in the
clockevent cases looks to the event handler function pointer being filled
in by the registration code, permitting us to get in to situations where
asserted IRQs step in to the handler before registration has had a chance
to complete and hitting a NULL pointer deref.
In practice this is not an issue for most platforms, but some of them
with fairly special loaders (or that are chain-loading from another
kernel) may enter in to this situation. This fixes up the oops reported
by Rafael on hp6xx.
Reported-and-tested-by: Rafael Ignacio Zurita <rafaelignacio.zurita@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/clocksource/sh_mtu2.c')
-rw-r--r-- | drivers/clocksource/sh_mtu2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index 973e714d6051..4c8a759e60cd 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c @@ -221,15 +221,15 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_priv *p, ced->cpumask = cpumask_of(0); ced->set_mode = sh_mtu2_clock_event_mode; + pr_info("sh_mtu2: %s used for clock events\n", ced->name); + clockevents_register_device(ced); + ret = setup_irq(p->irqaction.irq, &p->irqaction); if (ret) { pr_err("sh_mtu2: failed to request irq %d\n", p->irqaction.irq); return; } - - pr_info("sh_mtu2: %s used for clock events\n", ced->name); - clockevents_register_device(ced); } static int sh_mtu2_register(struct sh_mtu2_priv *p, char *name, |