* [PATCH] misc: atmel-ssc: fix error check return value of platform_get_irq()
@ 2022-04-13 9:32 ` cgel.zte
0 siblings, 0 replies; 4+ messages in thread
From: cgel.zte @ 2022-04-13 9:32 UTC (permalink / raw)
To: codrin.ciubotariu
Cc: arnd, nicolas.ferre, alexandre.belloni, claudiu.beznea,
linux-arm-kernel, linux-kernel, Lv Ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
platform_get_irq() return negative value on failure, so null check of
ssc->irq is incorrect. Fix it by comparing whether it is less than zero.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
drivers/misc/atmel-ssc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index d6cd5537126c..5e7b290d9515 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -232,7 +232,7 @@ static int ssc_probe(struct platform_device *pdev)
clk_disable_unprepare(ssc->clk);
ssc->irq = platform_get_irq(pdev, 0);
- if (!ssc->irq) {
+ if (ssc->irq < 0) {
dev_dbg(&pdev->dev, "could not get irq\n");
return -ENXIO;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] misc: atmel-ssc: fix error check return value of platform_get_irq()
@ 2022-04-13 9:32 ` cgel.zte
0 siblings, 0 replies; 4+ messages in thread
From: cgel.zte @ 2022-04-13 9:32 UTC (permalink / raw)
To: codrin.ciubotariu
Cc: alexandre.belloni, arnd, Lv Ruyi, Zeal Robot, linux-kernel,
claudiu.beznea, linux-arm-kernel
From: Lv Ruyi <lv.ruyi@zte.com.cn>
platform_get_irq() return negative value on failure, so null check of
ssc->irq is incorrect. Fix it by comparing whether it is less than zero.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
drivers/misc/atmel-ssc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index d6cd5537126c..5e7b290d9515 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -232,7 +232,7 @@ static int ssc_probe(struct platform_device *pdev)
clk_disable_unprepare(ssc->clk);
ssc->irq = platform_get_irq(pdev, 0);
- if (!ssc->irq) {
+ if (ssc->irq < 0) {
dev_dbg(&pdev->dev, "could not get irq\n");
return -ENXIO;
}
--
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] 4+ messages in thread
* Re: [PATCH] misc: atmel-ssc: fix error check return value of platform_get_irq()
2022-04-13 9:32 ` cgel.zte
@ 2022-04-15 6:47 ` Codrin.Ciubotariu
-1 siblings, 0 replies; 4+ messages in thread
From: Codrin.Ciubotariu @ 2022-04-15 6:47 UTC (permalink / raw)
To: cgel.zte
Cc: arnd, Nicolas.Ferre, alexandre.belloni, Claudiu.Beznea,
linux-arm-kernel, linux-kernel, lv.ruyi, zealci
On 13.04.2022 12:32, cgel.zte@gmail.com wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> platform_get_irq() return negative value on failure, so null check of
> ssc->irq is incorrect. Fix it by comparing whether it is less than zero.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] misc: atmel-ssc: fix error check return value of platform_get_irq()
@ 2022-04-15 6:47 ` Codrin.Ciubotariu
0 siblings, 0 replies; 4+ messages in thread
From: Codrin.Ciubotariu @ 2022-04-15 6:47 UTC (permalink / raw)
To: cgel.zte
Cc: alexandre.belloni, arnd, lv.ruyi, zealci, linux-kernel,
Claudiu.Beznea, linux-arm-kernel
On 13.04.2022 12:32, cgel.zte@gmail.com wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> platform_get_irq() return negative value on failure, so null check of
> ssc->irq is incorrect. Fix it by comparing whether it is less than zero.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Thanks!
_______________________________________________
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] 4+ messages in thread
end of thread, other threads:[~2022-04-15 6:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 9:32 [PATCH] misc: atmel-ssc: fix error check return value of platform_get_irq() cgel.zte
2022-04-13 9:32 ` cgel.zte
2022-04-15 6:47 ` Codrin.Ciubotariu
2022-04-15 6:47 ` Codrin.Ciubotariu
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.