summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2009-03-23 17:43:12 +0000
committerPeter Stuge <peter@stuge.se>2009-03-23 17:43:12 +0000
commit5f28c09ce54c5dabd0aa4250203d2b38295a1fad (patch)
treeb6ea7c40cd99577dfab0dfad82ef88c32a7c7142 /util
parent4b10ab3782ea30f9832efb297eb0f51eab36d20e (diff)
downloadcoreboot-5f28c09ce54c5dabd0aa4250203d2b38295a1fad.tar.xz
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 <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4026 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rw-r--r--util/msrtool/msrutils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/msrtool/msrutils.c b/util/msrtool/msrutils.c
index 32af32adf3..e2306e83dd 100644
--- a/util/msrtool/msrutils.c
+++ b/util/msrtool/msrutils.c
@@ -142,7 +142,7 @@ uint32_t msraddrbyname(const char *name) {
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 @@ uint32_t msraddrbyname(const char *name) {
if (!strcasecmp(name, m->symbol))
return m->addr;
}
- return 0;
+ return addr;
}
void dumpmsrdefs(const struct targetdef *t) {