aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mt6397.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-mt6397.c')
-rw-r--r--drivers/rtc/rtc-mt6397.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 964ed91416e1..671b6d275da3 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -339,6 +339,8 @@ static int mtk_rtc_probe(struct platform_device *pdev)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
+ return -EINVAL;
rtc->addr_base = res->start;
rtc->irq = platform_get_irq(pdev, 0);