Skip to content

Commit 354d8a4

Browse files
committed
x86/xen: silence smatch warning in pmu_msr_chk_emulated()
Commit 8714f7b ("xen/pv: add fault recovery control to pmu msr accesses") introduced code resulting in a warning issued by the smatch static checker, claiming to use an uninitialized variable. This is a false positive, but work around the warning nevertheless. Fixes: 8714f7b ("xen/pv: add fault recovery control to pmu msr accesses") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent a383dcb commit 354d8a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/xen/pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static bool xen_amd_pmu_emulate(unsigned int msr, u64 *val, bool is_read)
302302
static bool pmu_msr_chk_emulated(unsigned int msr, uint64_t *val, bool is_read,
303303
bool *emul)
304304
{
305-
int type, index;
305+
int type, index = 0;
306306

307307
if (is_amd_pmu_msr(msr))
308308
*emul = xen_amd_pmu_emulate(msr, val, is_read);

0 commit comments

Comments
 (0)