[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1530814859-11610-1-git-send-email-byan@nvidia.com>
Date: Thu, 5 Jul 2018 11:20:59 -0700
From: Bo Yan <byan@...dia.com>
To: <tglx@...utronix.de>, <jason@...edaemon.net>,
<marc.zyngier@....com>
CC: <linux-kernel@...r.kernel.org>, Bo Yan <byan@...dia.com>
Subject: [PATCH] irqchip/gic: check return value of of_address_to_resource
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@...dia.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
Powered by blists - more mailing lists