Showing error 1783

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: arch/x86/kvm/lapic.c
Line in file: 491
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

 461        unsigned int delivery_mode = icr_low & APIC_MODE_MASK;
 462        unsigned int vector = icr_low & APIC_VECTOR_MASK;
 463
 464        struct kvm_vcpu *target;
 465        struct kvm_vcpu *vcpu;
 466        unsigned long lpr_map = 0;
 467        int i;
 468
 469        apic_debug("icr_high 0x%x, icr_low 0x%x, "
 470                   "short_hand 0x%x, dest 0x%x, trig_mode 0x%x, level 0x%x, "
 471                   "dest_mode 0x%x, delivery_mode 0x%x, vector 0x%x\n",
 472                   icr_high, icr_low, short_hand, dest,
 473                   trig_mode, level, dest_mode, delivery_mode, vector);
 474
 475        for (i = 0; i < KVM_MAX_VCPUS; i++) {
 476                vcpu = apic->vcpu->kvm->vcpus[i];
 477                if (!vcpu)
 478                        continue;
 479
 480                if (vcpu->arch.apic &&
 481                    apic_match_dest(vcpu, apic, short_hand, dest, dest_mode)) {
 482                        if (delivery_mode == APIC_DM_LOWEST)
 483                                set_bit(vcpu->vcpu_id, &lpr_map);
 484                        else
 485                                __apic_accept_irq(vcpu->arch.apic, delivery_mode,
 486                                                  vector, level, trig_mode);
 487                }
 488        }
 489
 490        if (delivery_mode == APIC_DM_LOWEST) {
 491                target = kvm_get_lowest_prio_vcpu(vcpu->kvm, vector, lpr_map);
 492                if (target != NULL)
 493                        __apic_accept_irq(target->arch.apic, delivery_mode,
 494                                          vector, level, trig_mode);
 495        }
 496}
 497
 498static u32 apic_get_tmcct(struct kvm_lapic *apic)
 499{
 500        u64 counter_passed;
 501        ktime_t passed, now;
Show full sources