From 4008d7774cd951eeba907b7bfe84302abfa4377c Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 7 Feb 2017 11:02:40 +0000 Subject: [PATCH] fuzz/x86emul: remove bogus check against fuzzer msr index The "reg" variable in fuzz_read_msr stores the real MSR index, not an index within the fuzzer. The rest of that function already handles things correctly. We just need to remove the bogus check. Spotted by Coverity. Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper --- tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c b/tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c index 3b6d33aa25..4a2bdbe392 100644 --- a/tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c +++ b/tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c @@ -347,9 +347,6 @@ static int fuzz_read_msr( { unsigned int idx; - if ( reg >= MSR_INDEX_MAX ) - return X86EMUL_UNHANDLEABLE; - switch ( reg ) { case MSR_TSC_AUX: -- 2.30.2