From: Bo Yan <byan@nvidia.com>
To: <tglx@linutronix.de>, <jason@lakedaemon.net>, <marc.zyngier@arm.com>
Cc: <linux-kernel@vger.kernel.org>, Bo Yan <byan@nvidia.com>
Subject: [PATCH] irqchip/gic: check return value of of_address_to_resource
Date: Thu, 5 Jul 2018 11:20:59 -0700 [thread overview]
Message-ID: <1530814859-11610-1-git-send-email-byan@nvidia.com> (raw)
The of_address_to_resource returns 0 if successful. gic_check_eoimode
calls it without checking the return value. This induces Coverity
warning: "Unchecked return value".
Return false from gic_check_eoimode if of_address_to_resource returns
non-0 value.
Signed-off-by: Bo Yan <byan@nvidia.com>
---
drivers/irqchip/irq-gic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index ced10c4..0bceb10 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1284,7 +1284,8 @@ static bool gic_check_eoimode(struct device_node *node, void __iomem **base)
{
struct resource cpuif_res;
- of_address_to_resource(node, 1, &cpuif_res);
+ if (of_address_to_resource(node, 1, &cpuif_res))
+ return false;
if (!is_hyp_mode_available())
return false;
--
2.7.4
next reply other threads:[~2018-07-05 18:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 18:20 Bo Yan [this message]
2018-07-05 19:13 ` Marc Zyngier
2018-07-05 19:18 ` Bo Yan
2018-07-05 19:32 ` Bo Yan
2018-07-07 10:01 ` Marc Zyngier
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=1530814859-11610-1-git-send-email-byan@nvidia.com \
--to=byan@nvidia.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome