* [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
@ 2022-05-05 12:50 ` Yang Yingliang
0 siblings, 0 replies; 9+ messages in thread
From: Yang Yingliang @ 2022-05-05 12:50 UTC (permalink / raw)
To: linux-kernel, linux-rtc, linux-mediatek, linux-arm-kernel
Cc: eddie.huang, sean.wang, a.zummo, alexandre.belloni, lee.jones
It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.
Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/rtc/rtc-mt6397.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 80dc479a6ff0..1d297af80f87 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
@ 2022-05-05 12:50 ` Yang Yingliang
0 siblings, 0 replies; 9+ messages in thread
From: Yang Yingliang @ 2022-05-05 12:50 UTC (permalink / raw)
To: linux-kernel, linux-rtc, linux-mediatek, linux-arm-kernel
Cc: eddie.huang, sean.wang, a.zummo, alexandre.belloni, lee.jones
It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.
Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/rtc/rtc-mt6397.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 80dc479a6ff0..1d297af80f87 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -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);
--
2.25.1
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
@ 2022-05-05 12:50 ` Yang Yingliang
0 siblings, 0 replies; 9+ messages in thread
From: Yang Yingliang @ 2022-05-05 12:50 UTC (permalink / raw)
To: linux-kernel, linux-rtc, linux-mediatek, linux-arm-kernel
Cc: eddie.huang, sean.wang, a.zummo, alexandre.belloni, lee.jones
It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.
Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/rtc/rtc-mt6397.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c
index 80dc479a6ff0..1d297af80f87 100644
--- a/drivers/rtc/rtc-mt6397.c
+++ b/drivers/rtc/rtc-mt6397.c
@@ -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);
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
2022-05-05 12:50 ` Yang Yingliang
(?)
@ 2022-05-05 14:55 ` AngeloGioacchino Del Regno
-1 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-05-05 14:55 UTC (permalink / raw)
To: Yang Yingliang, linux-kernel, linux-rtc, linux-mediatek,
linux-arm-kernel
Cc: eddie.huang, sean.wang, a.zummo, alexandre.belloni, lee.jones
Il 05/05/22 14:50, Yang Yingliang ha scritto:
> It will cause null-ptr-deref if platform_get_resource() returns NULL,
> we need check the return value.
>
> Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
@ 2022-05-05 14:55 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-05-05 14:55 UTC (permalink / raw)
To: Yang Yingliang, linux-kernel, linux-rtc, linux-mediatek,
linux-arm-kernel
Cc: eddie.huang, sean.wang, a.zummo, alexandre.belloni, lee.jones
Il 05/05/22 14:50, Yang Yingliang ha scritto:
> It will cause null-ptr-deref if platform_get_resource() returns NULL,
> we need check the return value.
>
> Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
@ 2022-05-05 14:55 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-05-05 14:55 UTC (permalink / raw)
To: Yang Yingliang, linux-kernel, linux-rtc, linux-mediatek,
linux-arm-kernel
Cc: eddie.huang, sean.wang, a.zummo, alexandre.belloni, lee.jones
Il 05/05/22 14:50, Yang Yingliang ha scritto:
> It will cause null-ptr-deref if platform_get_resource() returns NULL,
> we need check the return value.
>
> Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
2022-05-05 12:50 ` Yang Yingliang
(?)
@ 2022-05-19 10:06 ` Alexandre Belloni
-1 siblings, 0 replies; 9+ messages in thread
From: Alexandre Belloni @ 2022-05-19 10:06 UTC (permalink / raw)
To: linux-rtc, linux-kernel, linux-mediatek, linux-arm-kernel,
Yang Yingliang
Cc: a.zummo, sean.wang, lee.jones, eddie.huang
On Thu, 5 May 2022 20:50:43 +0800, Yang Yingliang wrote:
> It will cause null-ptr-deref if platform_get_resource() returns NULL,
> we need check the return value.
>
>
Applied, thanks!
[1/1] rtc: mt6397: check return value after calling platform_get_resource()
commit: d3b43eb505bffb8e4cdf6800c15660c001553fe6
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
@ 2022-05-19 10:06 ` Alexandre Belloni
0 siblings, 0 replies; 9+ messages in thread
From: Alexandre Belloni @ 2022-05-19 10:06 UTC (permalink / raw)
To: linux-rtc, linux-kernel, linux-mediatek, linux-arm-kernel,
Yang Yingliang
Cc: a.zummo, sean.wang, lee.jones, eddie.huang
On Thu, 5 May 2022 20:50:43 +0800, Yang Yingliang wrote:
> It will cause null-ptr-deref if platform_get_resource() returns NULL,
> we need check the return value.
>
>
Applied, thanks!
[1/1] rtc: mt6397: check return value after calling platform_get_resource()
commit: d3b43eb505bffb8e4cdf6800c15660c001553fe6
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] rtc: mt6397: check return value after calling platform_get_resource()
@ 2022-05-19 10:06 ` Alexandre Belloni
0 siblings, 0 replies; 9+ messages in thread
From: Alexandre Belloni @ 2022-05-19 10:06 UTC (permalink / raw)
To: linux-rtc, linux-kernel, linux-mediatek, linux-arm-kernel,
Yang Yingliang
Cc: a.zummo, sean.wang, lee.jones, eddie.huang
On Thu, 5 May 2022 20:50:43 +0800, Yang Yingliang wrote:
> It will cause null-ptr-deref if platform_get_resource() returns NULL,
> we need check the return value.
>
>
Applied, thanks!
[1/1] rtc: mt6397: check return value after calling platform_get_resource()
commit: d3b43eb505bffb8e4cdf6800c15660c001553fe6
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-05-19 10:07 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 12:50 [PATCH] rtc: mt6397: check return value after calling platform_get_resource() Yang Yingliang
2022-05-05 12:50 ` Yang Yingliang
2022-05-05 12:50 ` Yang Yingliang
2022-05-05 14:55 ` AngeloGioacchino Del Regno
2022-05-05 14:55 ` AngeloGioacchino Del Regno
2022-05-05 14:55 ` AngeloGioacchino Del Regno
2022-05-19 10:06 ` Alexandre Belloni
2022-05-19 10:06 ` Alexandre Belloni
2022-05-19 10:06 ` Alexandre Belloni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.