In the current code, symbol information related to zram is initialized
even when a given disk is not zram. It should be done after the disk
turns out to be zram.
Signed-off-by: HATAYAMA Daisuke <d.hatayama(a)fujitsu.com>
---
diskdump.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/diskdump.c b/diskdump.c
index 52a255a..9680629 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -2725,9 +2725,6 @@ try_zram_decompress(ulonglong pte_val, unsigned char *buf, ulong
len, ulonglong
unsigned char *zram_buf = NULL;
unsigned char *outbuf = NULL;
- if (INVALID_MEMBER(zram_compressor))
- zram_init();
-
off = PAGEOFFSET(vaddr);
if (!symbol_exists("swap_info"))
return 0;
@@ -2758,6 +2755,9 @@ try_zram_decompress(ulonglong pte_val, unsigned char *buf, ulong
len, ulonglong
return 0;
}
+ if (INVALID_MEMBER(zram_compressor))
+ zram_init();
+
if (CRASHDEBUG(2))
error(WARNING, "this page has swapped to zram\n");
--
1.8.3.1