summaryrefslogtreecommitdiffstats
path: root/kernel/virt/kvm/irqchip.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/virt/kvm/irqchip.c')
-rw-r--r--kernel/virt/kvm/irqchip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/virt/kvm/irqchip.c b/kernel/virt/kvm/irqchip.c
index f0b08a2a4..7d31d8c5b 100644
--- a/kernel/virt/kvm/irqchip.c
+++ b/kernel/virt/kvm/irqchip.c
@@ -40,7 +40,7 @@ int kvm_irq_map_gsi(struct kvm *kvm,
irq_rt = srcu_dereference_check(kvm->irq_routing, &kvm->irq_srcu,
lockdep_is_held(&kvm->irq_lock));
- if (gsi < irq_rt->nr_rt_entries) {
+ if (irq_rt && gsi < irq_rt->nr_rt_entries) {
hlist_for_each_entry(e, &irq_rt->map[gsi], link) {
entries[n] = *e;
++n;