Skip to content
Commit a91d2bab authored by Wolfram Sang's avatar Wolfram Sang Committed by John Stultz
Browse files

rtc: stmp3xxx: Initialize drvdata before registering device

Commit f44f7f96

 ("RTC: Initialize kernel state from RTC") uncovered
an issue in a number of RTC drivers, where the drivers call
rtc_device_register before initializing the device or platform drvdata.

This frequently results in null pointer dereferences when the
rtc_device_register immediately makes use of the rtc device, calling
rtc_read_alarm.

The solution is to ensure the drvdata is initialized prior to registering
the rtc device.

Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Tested-by: default avatarShawn Guo <shawn.guo@freescale.com>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 46b21218
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment