[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANRm+Cy8mdqM-i_MBHxY6=Nbf=wdTN+k_2pcjEZc0BOZQzPwGg@mail.gmail.com>
Date: Wed, 4 Jan 2017 06:03:52 +0800
From: Wanpeng Li <kernellwp@...il.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: David Hildenbrand <david@...hat.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
KVM list <kvm@...r.kernel.org>,
Radim Krčmář <rkrcmar@...hat.com>,
Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [PATCH] KVM: ioapic: fix NULL deref ioapic->lock
2017-01-04 1:23 GMT+08:00 Paolo Bonzini <pbonzini@...hat.com>:
>
>
> On 03/01/2017 13:06, David Hildenbrand wrote:
>>>
>>> switch (cap->cap) {
>>> case KVM_CAP_HYPERV_SYNIC:
>>> - return kvm_hv_activate_synic(vcpu);
>>> + if (!irqchip_in_kernel(vcpu->kvm))
>>> + return -EINVAL;
>>> + else
>>
>> You can simply drop the else and return directly.
>>
>> Can't really say if this is the right fix, my first thought was that
>> a request has been set although it should never have been set for
>> that VCPU. Maybe that is an effect of synic being activated
>> (because synic code unconditionally later on sets the request).
>>
>> Fixing the cause of the request seems better than fixing up the result.
>
> Yes, I agree. Wanpeng's second patch is fine.
Thanks Paolo, I will send out a formal one soon.
Regards,
Wanpeng Li
Powered by blists - more mailing lists