Skip to content

Commit

Permalink
arm: Reject unknown GIC versions
Browse files Browse the repository at this point in the history
We would likely crash anyway due to irqchip containing only NULL
pointers.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Jun 26, 2016
1 parent 313bfa1 commit f4aa33b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hypervisor/arch/arm/irqchip.c
Expand Up @@ -224,6 +224,8 @@ int irqchip_init(void)
case 0x4:
memcpy(&irqchip, &gic_irqchip, sizeof(struct irqchip_ops));
break;
default:
goto err_no_distributor;
}

if (irqchip.init) {
Expand All @@ -234,7 +236,7 @@ int irqchip_init(void)
}

err_no_distributor:
printk("GIC: no distributor found\n");
printk("GIC: no supported distributor found\n");
arch_unmap_device(gicd_base, gicd_size);

return -ENODEV;
Expand Down

0 comments on commit f4aa33b

Please sign in to comment.