diff options
| author | Xin Li (Intel) <[email protected]> | 2025-05-17 16:57:12 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2025-05-21 06:44:31 +0000 |
| commit | e95534e107d2e9e136aa4d7cbededb3827e80074 (patch) | |
| tree | 3b6df10f47e9951ea13cda291f0dcf079694d4ea /samples/ftrace/sample-trace-array.c | |
| parent | x86/msr: Remove a superfluous inclusion of <asm/asm.h> (diff) | |
| download | kernel-e95534e107d2e9e136aa4d7cbededb3827e80074.tar.gz kernel-e95534e107d2e9e136aa4d7cbededb3827e80074.zip | |
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/[email protected]/
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Xin Li (Intel) <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'samples/ftrace/sample-trace-array.c')
0 files changed, 0 insertions, 0 deletions
