mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irqchip/gic: check return value of of_address_to_resource
@ 2018-07-05 18:20 Bo Yan
  2018-07-05 19:13 ` Marc Zyngier
  0 siblings, 1 reply; 5+ messages in thread
From: Bo Yan @ 2018-07-05 18:20 UTC (permalink / raw)
  To: tglx, jason, marc.zyngier; +Cc: linux-kernel, Bo Yan

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-07 10:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-05 18:20 [PATCH] irqchip/gic: check return value of of_address_to_resource Bo Yan
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

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