diff options
Diffstat (limited to 'arch/x86/kernel/crash_dump_64.c')
-rw-r--r-- | arch/x86/kernel/crash_dump_64.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c index 15e6c6bc4a46..045b36cada65 100644 --- a/arch/x86/kernel/crash_dump_64.c +++ b/arch/x86/kernel/crash_dump_64.c | |||
@@ -7,9 +7,11 @@ | |||
7 | 7 | ||
8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
9 | #include <linux/crash_dump.h> | 9 | #include <linux/crash_dump.h> |
10 | #include <linux/uaccess.h> | ||
11 | #include <linux/io.h> | ||
10 | 12 | ||
11 | #include <asm/uaccess.h> | 13 | /* Stores the physical address of elf header of crash image. */ |
12 | #include <asm/io.h> | 14 | unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; |
13 | 15 | ||
14 | /** | 16 | /** |
15 | * copy_oldmem_page - copy one page from "oldmem" | 17 | * copy_oldmem_page - copy one page from "oldmem" |
@@ -25,7 +27,7 @@ | |||
25 | * in the current kernel. We stitch up a pte, similar to kmap_atomic. | 27 | * in the current kernel. We stitch up a pte, similar to kmap_atomic. |
26 | */ | 28 | */ |
27 | ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | 29 | ssize_t copy_oldmem_page(unsigned long pfn, char *buf, |
28 | size_t csize, unsigned long offset, int userbuf) | 30 | size_t csize, unsigned long offset, int userbuf) |
29 | { | 31 | { |
30 | void *vaddr; | 32 | void *vaddr; |
31 | 33 | ||
@@ -33,14 +35,16 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | |||
33 | return 0; | 35 | return 0; |
34 | 36 | ||
35 | vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); | 37 | vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); |
38 | if (!vaddr) | ||
39 | return -ENOMEM; | ||
36 | 40 | ||
37 | if (userbuf) { | 41 | if (userbuf) { |
38 | if (copy_to_user(buf, (vaddr + offset), csize)) { | 42 | if (copy_to_user(buf, vaddr + offset, csize)) { |
39 | iounmap(vaddr); | 43 | iounmap(vaddr); |
40 | return -EFAULT; | 44 | return -EFAULT; |
41 | } | 45 | } |
42 | } else | 46 | } else |
43 | memcpy(buf, (vaddr + offset), csize); | 47 | memcpy(buf, vaddr + offset, csize); |
44 | 48 | ||
45 | iounmap(vaddr); | 49 | iounmap(vaddr); |
46 | return csize; | 50 | return csize; |