Author: stuge
Date: 2009-03-23 18:43:12 +0100 (Mon, 23 Mar 2009)
New Revision: 4026

Modified:
   trunk/util/msrtool/msrutils.c
Log:
msrtool: If an MSR name lookup fails in msraddrbyname(), return the strtoul() 
conversion result.

Thanks to Mart for finding and reporting the problem!

Signed-off-by: Peter Stuge <[email protected]>
Acked-by: Peter Stuge <[email protected]>


Modified: trunk/util/msrtool/msrutils.c
===================================================================
--- trunk/util/msrtool/msrutils.c       2009-03-21 11:52:29 UTC (rev 4025)
+++ trunk/util/msrtool/msrutils.c       2009-03-23 17:43:12 UTC (rev 4026)
@@ -142,7 +142,7 @@
        const uint32_t addr = strtoul(name, NULL, 16);
        const struct msrdef *m;
        if (!targets)
-               return 0;
+               return addr;
        for (t = 0; t < targets_found; t++)
                for (m = targets[t]->msrs; !MSR_ISEOT(*m); m++) {
                        if (addr == m->addr)
@@ -150,7 +150,7 @@
                        if (!strcasecmp(name, m->symbol))
                                return m->addr;
                }
-       return 0;
+       return addr;
 }
 
 void dumpmsrdefs(const struct targetdef *t) {


-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to