diff options
author | Xin Li (Intel) <xin@zytor.com> | 2025-05-17 09:57:12 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2025-05-21 08:44:31 +0200 |
commit | e95534e107d2e9e136aa4d7cbededb3827e80074 (patch) | |
tree | 3b6df10f47e9951ea13cda291f0dcf079694d4ea /scripts/lib/kdoc/kdoc_files.py | |
parent | 9220aa8a6779b586ef11bcd5473d103f7cf60756 (diff) |
x86/xen/msr: Fix uninitialized variable 'err'
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().
Closes: https://lore.kernel.org/xen-devel/aBxNI_Q0-MhtBSZG@stanley.mountain/
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Xin Li (Intel) <xin@zytor.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Link: https://lore.kernel.org/r/20250517165713.935384-1-xin@zytor.com
Diffstat (limited to 'scripts/lib/kdoc/kdoc_files.py')
0 files changed, 0 insertions, 0 deletions