From 09a75e95f2f56c24d74263becd13897c0b58d00f Mon Sep 17 00:00:00 2001 From: Xorg Date: Sun, 12 Feb 2017 20:13:41 +0100 Subject: [PATCH] RDMSR: fix returned value on NULL handler It should return CPU_INVALID_VALUE on error, not ERR_HANDLE --- libcpuid/rdmsr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libcpuid/rdmsr.c b/libcpuid/rdmsr.c index 0674b15..fc11b19 100644 --- a/libcpuid/rdmsr.c +++ b/libcpuid/rdmsr.c @@ -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);