aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2017-03-27 10:24:27 -0700
committerAndi Kleen <ak@linux.intel.com>2017-03-27 10:24:27 -0700
commit1a632c42ad434897b9639a46a511c0b25deff398 (patch)
tree96e9d66433e50773d932e027dc6cc67e178300f2
parentad66dd599e8981f5433758ae6da4e8ae07c02258 (diff)
downloadmcelog-1a632c42ad434897b9639a46a511c0b25deff398.tar.gz
mcelog: Fix (harmless) off by one error in DMI scanning
Found by Klocwork. Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--dmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dmi.c b/dmi.c
index 35dbc36..af584c6 100644
--- a/dmi.c
+++ b/dmi.c
@@ -314,7 +314,7 @@ legacy:
goto out;
}
- for (p = abase, q = p + segsize; p < q; p += 0x10) {
+ for (p = abase, q = p + segsize - 1; p < q; p += 0x10) {
if (!memcmp(p, "_SM_", 4) &&
(checksum(p, ((struct anchor *)p)->entry_length) == 0))
break;