From f4aa33bef18a6a17069f46915b92ea935e78b107 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Thu, 16 Jun 2016 11:20:37 +0200 Subject: [PATCH] arm: Reject unknown GIC versions We would likely crash anyway due to irqchip containing only NULL pointers. Signed-off-by: Jan Kiszka --- hypervisor/arch/arm/irqchip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hypervisor/arch/arm/irqchip.c b/hypervisor/arch/arm/irqchip.c index a1772200e..26b3026de 100644 --- a/hypervisor/arch/arm/irqchip.c +++ b/hypervisor/arch/arm/irqchip.c @@ -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) { @@ -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;