KVM: apic: avoid calculating pending eoi from an uninitialized val
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 ofpv_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
Reviewed-by Vitaly Kuznetsov <[email protected]>But why compilers don't complain?
Maybe it's because @val only remain uninitialized when pv_eoi_get_user() failed?