]> xenbits.xensource.com Git - xen.git/commitdiff
fuzz/x86emul: remove bogus check against fuzzer msr index
authorWei Liu <wei.liu2@citrix.com>
Tue, 7 Feb 2017 11:02:40 +0000 (11:02 +0000)
committerWei Liu <wei.liu2@citrix.com>
Wed, 8 Feb 2017 09:24:13 +0000 (09:24 +0000)
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 <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/fuzz/x86_instruction_emulator/x86-insn-emulator-fuzzer.c

index 3b6d33aa25dad45ce640a5652ac814a74f1ae49a..4a2bdbe392a47eea47654871fe30a4690d44110d 100644 (file)
@@ -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: