mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
rtc: omap: fix potential crash on power off
Do not set the system power-off callback and omap power-off rtc pointer
until we're done setting up our device to avoid leaving stale pointers
around after a late probe error.
Fixes: 97ea1906b3 ("rtc: omap: Support ext_wakeup configuration")
Cc: stable <[email protected]> # 4.9
Cc: Marcin Niestroj <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Reviewed-by: Marcin Niestroj <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
This commit is contained in:
parent
2b4f07e99e
commit
5c8b84f410
1 changed files with 7 additions and 7 deletions
|
|
@ -861,13 +861,6 @@ static int omap_rtc_probe(struct platform_device *pdev)
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (rtc->is_pmic_controller) {
|
||||
if (!pm_power_off) {
|
||||
omap_rtc_power_off_rtc = rtc;
|
||||
pm_power_off = omap_rtc_power_off;
|
||||
}
|
||||
}
|
||||
|
||||
/* Support ext_wakeup pinconf */
|
||||
rtc_pinctrl_desc.name = dev_name(&pdev->dev);
|
||||
|
||||
|
|
@ -884,6 +877,13 @@ static int omap_rtc_probe(struct platform_device *pdev)
|
|||
|
||||
rtc_nvmem_register(rtc->rtc, &omap_rtc_nvmem_config);
|
||||
|
||||
if (rtc->is_pmic_controller) {
|
||||
if (!pm_power_off) {
|
||||
omap_rtc_power_off_rtc = rtc;
|
||||
pm_power_off = omap_rtc_power_off;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
|
|
|
|||
Loading…
Reference in a new issue