clocksource: efm32: Fix a NULL pointer dereference
authorYongbae Park <yongbae2@gmail.com>
Tue, 3 Mar 2015 10:46:49 +0000 (19:46 +0900)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:29 +0000 (20:11 -0400)
commit3c6527a54302f6ad724c8657a03dc4cdf64abe6c
tree77cbe14c8bd0f2ea833625358233e4a724e9321e
parent5a0ed0a9019725dbd985d793f8cfc7125ee24904
clocksource: efm32: Fix a NULL pointer dereference

[ Upstream commit 7b8f10da3bf1056546133c9f54f49ce389fd95ab ]

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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yongbae Park <yongbae2@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/clocksource/time-efm32.c