linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] EDAC/altera: add platform_get_irq error checking
@ 2022-09-09  5:38 Yu Zhe
  2022-09-12 11:26 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Yu Zhe @ 2022-09-09  5:38 UTC (permalink / raw)
  To: dinguyen, bp, mchehab, tony.luck, james.morse, rric
  Cc: linux-edac, linux-kernel, kernel-janitors, liqiong, Yu Zhe

The platform_get_irq() function returns negative error codes on error,
check it.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 drivers/edac/altera_edac.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index e7e8e624a436..79c7c97c7a46 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -355,6 +355,8 @@ static int altr_sdram_probe(struct platform_device *pdev)
 
 	/* Arria10 has a 2nd IRQ */
 	irq2 = platform_get_irq(pdev, 1);
+	if (irq2 < 0)
+		return irq2;
 
 	layers[0].type = EDAC_MC_LAYER_CHIP_SELECT;
 	layers[0].size = 1;
-- 
2.11.0


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

end of thread, other threads:[~2022-09-12 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  5:38 [PATCH] EDAC/altera: add platform_get_irq error checking Yu Zhe
2022-09-12 11:26 ` Dan Carpenter

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).