Skip to content

Commit

Permalink
irqchip/mips-gic: Check the return value of ioremap() in gic_of_init()
Browse files Browse the repository at this point in the history
[ Upstream commit 71349cc ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
William Dean authored and gregkh committed Aug 17, 2022
1 parent f066e01 commit f0d6618
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/irqchip/irq-mips-gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,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 = gicconfig & GIC_CONFIG_NUMINTERRUPTS;
Expand Down

0 comments on commit f0d6618

Please sign in to comment.