[PATCH 2/3] staging: irda: Handle return value of platform_get_irq

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

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux