Merge tag 'drm-next-2022-06-03-1' of git://anongit.freedesktop.org/drm/drm
[linux-2.6-microblaze.git] / drivers / rtc / rtc-mt6397.c
index 80dc479..1d297af 100644 (file)
@@ -269,6 +269,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->data = of_device_get_match_data(&pdev->dev);