netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org,
	samuel@sortiz.org
Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 2/3] staging: irda: Handle return value of platform_get_irq
Date: Thu, 30 Nov 2017 21:13:35 +0530	[thread overview]
Message-ID: <1512056616-21065-3-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1512056616-21065-1-git-send-email-arvind.yadav.cs@gmail.com>

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.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

  parent reply	other threads:[~2017-11-30 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 15:43 [PATCH 0/3] Handle return value of platform_get_irq Arvind Yadav
2017-11-30 15:43 ` [PATCH 1/3] iio: trigger: Fix platform_get_irq's error checking Arvind Yadav
     [not found]   ` <1512056616-21065-2-git-send-email-arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-02 12:22     ` Jonathan Cameron
2017-11-30 15:43 ` Arvind Yadav [this message]
2017-11-30 16:41   ` [PATCH 2/3] staging: irda: Handle return value of platform_get_irq Greg KH
2017-11-30 16:45     ` arvindY
2017-11-30 15:43 ` [PATCH 3/3] staging: irda: Remove unnecessary 'err' initialization Arvind Yadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512056616-21065-3-git-send-email-arvind.yadav.cs@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=samuel@sortiz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).