1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-02-12 20:24:05 +00:00

RDMSR: fix returned value on NULL handler

It should return CPU_INVALID_VALUE on error, not ERR_HANDLE
This commit is contained in:
Xorg 2017-02-12 20:13:41 +01:00
parent e7bfcc3651
commit 09a75e95f2

View file

@ -913,8 +913,10 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which)
static struct internal_id_info_t internal;
static struct msr_info_t info;
if (handle == NULL)
return set_error(ERR_HANDLE);
if (handle == NULL) {
set_error(ERR_HANDLE);
return CPU_INVALID_VALUE;
}
if (!init) {
err = cpuid_get_raw_data(&raw);