[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1512056616-21065-3-git-send-email-arvind.yadav.cs@gmail.com>
Date: Thu, 30 Nov 2017 21:13:35 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: lars@...afoo.de, Michael.Hennerich@...log.com, jic23@...nel.org,
knaack.h@....de, pmeerw@...erw.net, gregkh@...uxfoundation.org,
samuel@...tiz.org
Cc: linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
devel@...verdev.osuosl.org, netdev@...r.kernel.org
Subject: [PATCH 2/3] staging: irda: Handle return value of platform_get_irq
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
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
Powered by blists - more mailing lists