[Crash-utility] [PATCH] correct a mistake of reading kimage_voffset

zhizhou.zh at gmail.com zhizhou.zh at gmail.com
Wed Jan 18 05:45:46 UTC 2017


From: Zhizhou Zhang <zhizhouzhang at asrmicro.com>

kernel defines VMCOREINFO_NUMBER as follow. so we should use atol rather than
htol to get value of kimage_voffset.

  #define VMCOREINFO_NUMBER(name) \
  vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name)

Signed-off-by: Zhizhou Zhang <zhizhouzhang at asrmicro.com>
---
 arm64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arm64.c b/arm64.c
index 6eaf96d..f79f0a5 100644
--- a/arm64.c
+++ b/arm64.c
@@ -119,7 +119,7 @@ arm64_init(int when)
 
 		if (!ms->kimage_voffset &&
 		    (string = pc->read_vmcoreinfo("NUMBER(kimage_voffset)"))) {
-			ms->kimage_voffset = htol(string, QUIET, NULL);
+			ms->kimage_voffset = atol(string);
 			free(string);
 		}
 
-- 
1.9.1




More information about the Crash-utility mailing list