[PATCH] EDAC/altera: add platform_get_irq error checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Yu Zhe <yuzhe@xxxxxxxxxxxx>
---
 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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux