Skip to contentSkip to conversation

KVM: apic: avoid calculating pending eoi from an uninitialized val

PATCH linmiaohe 1 participant 1 message Feb 21, 2020 KVM

lore
Share & tools
lore

linmiaohe

author
#0 lore raw
Quoted 8 lines · Vitaly Kuznetsov
Quoted 3 lines · linmiaohe

When get user eoi value failed, var val would be uninitialized and result in calculating pending eoi from an uninitialized val. Initialize var val to 0 to fix this case.

Let me try to suggest an alternative wording,

"When pv_eoi_get_user() fails, 'val' may remain uninitialized and the return value of pv_eoi_get_pending() becomes random. Fix the issue by initializing the variable."

Sounds much better. You're really good at it. :) Thanks.

Quoted 5 lines
Quoted 2 lines

But why compilers don't complain?

Maybe it's because @val only remain uninitialized when pv_eoi_get_user() failed?