* [PATCH] cpuid: increment over size of cpu array, not just first one.
@ 2016-11-04 10:44 Rusty Russell
0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2016-11-04 10:44 UTC (permalink / raw)
To: Ahmed Samy; +Cc: ccan
Found by PCS Suite.
Reported-by: Jon Griffiths
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff --git a/ccan/cpuid/cpuid.c b/ccan/cpuid/cpuid.c
index 9a42d83..4510def 100644
--- a/ccan/cpuid/cpuid.c
+++ b/ccan/cpuid/cpuid.c
@@ -237,7 +237,7 @@ cputype_t cpuid_get_cpu_type(void)
uint32_t i;
get_cpuid(CPUID_VENDORID, &i, &u.bufu32[0], &u.bufu32[2], &u.bufu32[1]);
- for (i = 0; i < sizeof(c_cpunames) / sizeof(c_cpunames); ++i) {
+ for (i = 0; i < sizeof(c_cpunames) / sizeof(c_cpunames[0]); ++i) {
if (strncmp(c_cpunames[i], u.buf, 12) == 0) {
cputype = (cputype_t)i;
break;
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-04 10:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 10:44 [PATCH] cpuid: increment over size of cpu array, not just first one Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox