Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

William Dean and committed by
Marc Zyngier
71349cc8 c904cda0

+4
+4
drivers/irqchip/irq-mips-gic.c
··· 734 734 } 735 735 736 736 mips_gic_base = ioremap(gic_base, gic_len); 737 + if (!mips_gic_base) { 738 + pr_err("Failed to ioremap gic_base\n"); 739 + return -ENOMEM; 740 + } 737 741 738 742 gicconfig = read_gic_config(); 739 743 gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig);