mirror of https://gitee.com/openkylin/qemu.git
kvm/apic: correct short memset
kvm_put_apic_state's attempt to clear *kapic before setting its bits cleared sizeof(void*) bytes (no more than 8) rather than the intended 1024 (KVM_APIC_REG_SIZE) bytes. Spotted by coverity. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
dbaf26b3b2
commit
0614cb82ca
|
@ -30,7 +30,7 @@ void kvm_put_apic_state(DeviceState *d, struct kvm_lapic_state *kapic)
|
|||
APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
|
||||
int i;
|
||||
|
||||
memset(kapic, 0, sizeof(kapic));
|
||||
memset(kapic, 0, sizeof(*kapic));
|
||||
kvm_apic_set_reg(kapic, 0x2, s->id << 24);
|
||||
kvm_apic_set_reg(kapic, 0x8, s->tpr);
|
||||
kvm_apic_set_reg(kapic, 0xd, s->log_dest << 24);
|
||||
|
|
Loading…
Reference in New Issue