1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

Fixed a bug in Linux MSR readout. The address of the MSR is the msr_index, not msr_index*8

git-svn-id: https://svn.code.sf.net/p/libcpuid/code/HEAD/libcpuid@73 3b4be424-7ac5-41d7-8526-f4ddcb85d872
This commit is contained in:
Veselin Georgiev 2009-10-02 07:45:17 +00:00
parent 4729960411
commit 277eb73da7

View file

@ -91,7 +91,7 @@ int cpu_rdmsr(struct msr_driver_t* driver, int msr_index, uint64_t* result)
if (!driver || driver->fd < 0)
return set_error(ERR_HANDLE);
ret = pread(driver->fd, result, 8, msr_index * 8);
ret = pread(driver->fd, result, 8, msr_index);
if (ret != 8)
return set_error(ERR_INVMSR);
return 0;