summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorWilliam Dean <williamsukatube@163.com>2022-07-23 12:01:28 +0200
committerMarc Zyngier <maz@kernel.org>2022-07-24 11:54:44 +0200
commit71349cc85e5930dce78ed87084dee098eba24b59 (patch)
tree21e35fc3bc82816180fe9813dd342140a6e752ba /drivers/irqchip
parentgenirq: Use for_each_action_of_desc in actions_show() (diff)
downloadlinux-71349cc85e5930dce78ed87084dee098eba24b59.tar.xz
linux-71349cc85e5930dce78ed87084dee098eba24b59.zip
irqchip/mips-gic: Check the return value of ioremap() in gic_of_init()
The function ioremap() in gic_of_init() can fail, so its return value should be checked. Reported-by: Hacash Robot <hacashRobot@santino.com> Signed-off-by: William Dean <williamsukatube@163.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220723100128.2964304-1-williamsukatube@163.com
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-mips-gic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index ff89b36267dd..a1f6d955794a 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -734,6 +734,10 @@ static int __init gic_of_init(struct device_node *node,
}
mips_gic_base = ioremap(gic_base, gic_len);
+ if (!mips_gic_base) {
+ pr_err("Failed to ioremap gic_base\n");
+ return -ENOMEM;
+ }
gicconfig = read_gic_config();
gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig);