提交 7b8f10da 编写于 作者: Y Yongbae Park 提交者: Daniel Lezcano

clocksource: efm32: Fix a NULL pointer dereference

The initialisation of the efm32 clocksource first sets up the irq and only
after that initialises the data needed for irq handling. In case this
initialisation is delayed the irq handler would dereference a NULL pointer.

I'm not aware of anything that could delay the process in such a way, but it's
better to be safe than sorry, so setup the irq only when the clock event device
is ready.

Cc: stable@vger.kernel.org
Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NYongbae Park <yongbae2@gmail.com>
Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
上级 13a7a6ac
......@@ -225,12 +225,12 @@ static int __init efm32_clockevent_init(struct device_node *np)
clock_event_ddata.base = base;
clock_event_ddata.periodic_top = DIV_ROUND_CLOSEST(rate, 1024 * HZ);
setup_irq(irq, &efm32_clock_event_irq);
clockevents_config_and_register(&clock_event_ddata.evtdev,
DIV_ROUND_CLOSEST(rate, 1024),
0xf, 0xffff);
setup_irq(irq, &efm32_clock_event_irq);
return 0;
err_get_irq:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册