fix: mocking value for read_msr

we were returning the mocking value before actually setting it.
also remove spaces around the returned value (no behavior change)
This commit is contained in:
Stéphane Lesimple 2019-09-21 18:50:08 +02:00
parent 0518604fe6
commit cc224c0522

View File

@ -2071,8 +2071,6 @@ read_msr()
_debug "read_msr: MOCKING enabled for msr $_msr, returning $read_msr_value"
mocked=1
return 0
else
mockme=$(printf "%b\n%b" "$mockme" "SMC_MOCK_RDMSR_${_msr}='$read_msr_value'")
fi
_mockvarname="SMC_MOCK_RDMSR_${_msr}_RET"
@ -2121,7 +2119,10 @@ read_msr()
mockme=$(printf "%b\n%b" "$mockme" "SMC_MOCK_RDMSR_${_msr}_RET=1")
return 1
fi
# remove sparse spaces od might give us
read_msr_value=$(( read_msr_value ))
fi
mockme=$(printf "%b\n%b" "$mockme" "SMC_MOCK_RDMSR_${_msr}='$read_msr_value'")
_debug "read_msr: MSR=$_msr value is $read_msr_value"
return 0
}