linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error
@ 2020-08-27  7:07 Krzysztof Kozlowski
  2020-08-27  7:07 ` [PATCH 2/2] EDAC/ti: " Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-27  7:07 UTC (permalink / raw)
  To: Stefan Schaeckeler, Borislav Petkov, Mauro Carvalho Chehab,
	Tony Luck, James Morse, Robert Richter, Joel Stanley,
	Andrew Jeffery, Tero Kristo, linux-edac, linux-arm-kernel,
	linux-aspeed, linux-kernel
  Cc: Krzysztof Kozlowski

platform_get_irq() returns -ERRNO on error.  In such case comparison
to 0 would pass the check.

Fixes: 9b7e6242ee4e ("EDAC, aspeed: Add an Aspeed AST2500 EDAC driver")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/edac/aspeed_edac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
index b194658b8b5c..fbec28dc661d 100644
--- a/drivers/edac/aspeed_edac.c
+++ b/drivers/edac/aspeed_edac.c
@@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev)
 	/* register interrupt handler */
 	irq = platform_get_irq(pdev, 0);
 	dev_dbg(&pdev->dev, "got irq %d\n", irq);
-	if (!irq)
-		return -ENODEV;
+	if (irq < 0)
+		return irq;
 
 	rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH,
 			      DRV_NAME, ctx);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-01 18:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  7:07 [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error Krzysztof Kozlowski
2020-08-27  7:07 ` [PATCH 2/2] EDAC/ti: " Krzysztof Kozlowski
2020-08-27  7:13   ` Tero Kristo
     [not found] ` <0D9EC2D2-C4A0-42E9-94A5-DCFBE7BFEC43@cisco.com>
2020-08-27 23:49   ` [PATCH 1/2] EDAC/aspeed: " Stefan Schaeckeler
2020-09-01 18:51 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).