From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: myungjoo.ham@samsung.com, cw00.choi@samsung.com, wens@csie.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] extcon: axp288:: Handle return value of platform_get_irq
Date: Thu, 23 Nov 2017 21:25:30 +0530 [thread overview]
Message-ID: <1511452530-16858-3-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1511452530-16858-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/extcon/extcon-axp288.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 981fba5..e16a783 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -301,6 +301,9 @@ static int axp288_extcon_probe(struct platform_device *pdev)
for (i = 0; i < EXTCON_IRQ_END; i++) {
pirq = platform_get_irq(pdev, i);
+ if (pirq < 0)
+ return pirq;
+
info->irq[i] = regmap_irq_get_virq(info->regmap_irqc, pirq);
if (info->irq[i] < 0) {
dev_err(&pdev->dev,
--
2.7.4
next prev parent reply other threads:[~2017-11-23 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171123155542epcas3p38259ac96b30879770cf72c83d199815b@epcas3p3.samsung.com>
2017-11-23 15:55 ` [PATCH 0/2] Handle return value and error checking " Arvind Yadav
2017-11-23 15:55 ` [PATCH 1/2] extcon: adc-jack: Fix platform_get_irq's error checking Arvind Yadav
2017-11-23 15:55 ` Arvind Yadav [this message]
2017-11-24 0:07 ` [PATCH 0/2] Handle return value and error checking of platform_get_irq Chanwoo Choi
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=1511452530-16858-3-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=wens@csie.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
all inboxes | Powered by JetHome®