It took till the 4.5 backports of the L1TF prereqs that gcc 8.2 finally
noticed that the vPMU callers, not checking the function's return value,
may consume uninitialized data. Guard against this by storing zero on
the error path.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
const struct vmx_msr_entry *ent = vmx_find_msr(v, msr, VMX_MSR_GUEST);
if ( !ent )
+ {
+ *val = 0;
return -ESRCH;
+ }
*val = ent->data;
vmx_find_msr(v, msr, VMX_MSR_GUEST_LOADONLY);
if ( !ent )
+ {
+ *val = 0;
return -ESRCH;
+ }
*val = ent->data;