diff options
-rw-r--r-- | arch/x86/kernel/crash_dump_64.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c index 15e6c6bc4a46..280d6ef3af02 100644 --- a/arch/x86/kernel/crash_dump_64.c +++ b/arch/x86/kernel/crash_dump_64.c | |||
@@ -33,14 +33,16 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | |||
33 | return 0; | 33 | return 0; |
34 | 34 | ||
35 | vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); | 35 | vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); |
36 | if (!vaddr) | ||
37 | return -ENOMEM; | ||
36 | 38 | ||
37 | if (userbuf) { | 39 | if (userbuf) { |
38 | if (copy_to_user(buf, (vaddr + offset), csize)) { | 40 | if (copy_to_user(buf, vaddr + offset, csize)) { |
39 | iounmap(vaddr); | 41 | iounmap(vaddr); |
40 | return -EFAULT; | 42 | return -EFAULT; |
41 | } | 43 | } |
42 | } else | 44 | } else |
43 | memcpy(buf, (vaddr + offset), csize); | 45 | memcpy(buf, vaddr + offset, csize); |
44 | 46 | ||
45 | iounmap(vaddr); | 47 | iounmap(vaddr); |
46 | return csize; | 48 | return csize; |