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
This commit is contained in:
@@ -142,7 +142,7 @@ uint32_t msraddrbyname(const char *name) {
|
|||||||
const uint32_t addr = strtoul(name, NULL, 16);
|
const uint32_t addr = strtoul(name, NULL, 16);
|
||||||
const struct msrdef *m;
|
const struct msrdef *m;
|
||||||
if (!targets)
|
if (!targets)
|
||||||
return 0;
|
return addr;
|
||||||
for (t = 0; t < targets_found; t++)
|
for (t = 0; t < targets_found; t++)
|
||||||
for (m = targets[t]->msrs; !MSR_ISEOT(*m); m++) {
|
for (m = targets[t]->msrs; !MSR_ISEOT(*m); m++) {
|
||||||
if (addr == m->addr)
|
if (addr == m->addr)
|
||||||
@@ -150,7 +150,7 @@ uint32_t msraddrbyname(const char *name) {
|
|||||||
if (!strcasecmp(name, m->symbol))
|
if (!strcasecmp(name, m->symbol))
|
||||||
return m->addr;
|
return m->addr;
|
||||||
}
|
}
|
||||||
return 0;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dumpmsrdefs(const struct targetdef *t) {
|
void dumpmsrdefs(const struct targetdef *t) {
|
||||||
|
Reference in New Issue
Block a user