]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
ras-mce-handler: fix /proc/cpuinfo parser
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 24 May 2013 11:21:51 +0000 (08:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 24 May 2013 11:21:51 +0000 (08:21 -0300)
The scanf parsers for /proc/cpuinfo were broken, as they
got a "mce->" prefix by mistake. Remove it to fix.

With that, MCE parser will successfully register.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
ras-mce-handler.c

index 693590196a41802ff61d583cd440a910b3c1fe5a..6231d561762139fbbc6801f64dc08f006c365dcc 100644 (file)
@@ -127,12 +127,12 @@ static int detect_cpu(struct ras_events *ras)
        }
 
        while (getdelim(&line, &linelen, '\n', f) > 0 && seen != ALL) {
-               if (sscanf(line, "mce->vendor_id : %63[^\n]",
+               if (sscanf(line, "vendor_id : %63[^\n]",
                    (char *)&mce->vendor) == 1)
                        seen |= VENDOR;
-               if (sscanf(line, "cpu mce->family : %d", &mce->family) == 1)
+               if (sscanf(line, "cpu family : %d", &mce->family) == 1)
                        seen |= FAMILY;
-               if (sscanf(line, "mce->model : %d", &mce->model) == 1)
+               if (sscanf(line, "model : %d", &mce->model) == 1)
                        seen |= MODEL;
                if (sscanf(line, "cpu MHz : %lf", &mce->mhz) == 1)
                        seen |= MHZ;