[PATCH 2/3] staging: irda: Handle return value of platform_get_irq
From: Arvind Yadav
Date: Thu Nov 30 2017 - 10:44:08 EST
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@xxxxxxxxx>
---
drivers/staging/irda/drivers/pxaficp_ir.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/staging/irda/drivers/pxaficp_ir.c b/drivers/staging/irda/drivers/pxaficp_ir.c
index 1dba16b..a97ce04 100644
--- a/drivers/staging/irda/drivers/pxaficp_ir.c
+++ b/drivers/staging/irda/drivers/pxaficp_ir.c
@@ -960,7 +960,17 @@ static int pxa_irda_probe(struct platform_device *pdev)
si->irda_base = ficp;
si->stuart_base = stuart;
si->uart_irq = platform_get_irq(pdev, 0);
+ if (si->uart_irq < 0) {
+ err = si->uart_irq;
+ goto err_mem_1;
+ }
+
si->icp_irq = platform_get_irq(pdev, 1);
+ if (si->icp_irq < 0) {
+ err = si->icp_irq;
+ goto err_mem_1;
+ }
+
si->sir_clk = devm_clk_get(&pdev->dev, "UARTCLK");
si->fir_clk = devm_clk_get(&pdev->dev, "FICPCLK");
--
2.7.4