On 17.05.25 18:57, Xin Li (Intel) wrote:
xen_read_msr_safe() currently passes an uninitialized argument err to xen_do_read_msr(). But as xen_do_read_msr() may not set the argument, xen_read_msr_safe() could return err with an unpredictable value.To ensure correctness, initialize err to 0 (representing success) in xen_read_msr_safe(). Do the same in xen_read_msr(), even err is not used after being passed to xen_do_read_msr(). Fixes: d815da84fdd0 ("x86/msr: Change the function type of native_read_msr_safe()" Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/xen-devel/[email protected]/ Signed-off-by: Xin Li (Intel) <[email protected]>
Reviewed-by: Juergen Gross <[email protected]> Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
