From 59cd18b0932c6f9edfc83d774bf5464b908ae988 Mon Sep 17 00:00:00 2001 From: Stanislav Galabov Date: Mon, 6 Feb 2017 14:58:24 +0000 Subject: [PATCH] sys/arm/arm/identcpu-v4.c: fix identify_arm_cpu() identify_arm_cpu() in sys/arm/arm/identcpu-v4.c incorrectly uses a u_int8_t variable to store the result of cpu_get_control(). It should really use a u_int variable, the same way as done for cpu_ident() in the same function, as both cpuid and control registers are 32-bit.. This issue causes users of identcpu-v4 to incorrectly report things such as icache status (bit 12 in cpu control register) and basically anything defined in bits above bit 7 :-) Reviewed by: manu Sponsored by: Smartcom - Bulgaria AD Differential Revision: https://reviews.freebsd.org/D9460 --- sys/arm/arm/identcpu-v4.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/arm/arm/identcpu-v4.c b/sys/arm/arm/identcpu-v4.c index 43f2648674cf..af760799d938 100644 --- a/sys/arm/arm/identcpu-v4.c +++ b/sys/arm/arm/identcpu-v4.c @@ -294,8 +294,7 @@ u_int cpu_pfr(int num) void identify_arm_cpu(void) { - u_int cpuid; - u_int8_t ctrl; + u_int cpuid, ctrl; int i; ctrl = cpu_get_control();