aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/crash_dump_64.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2008-09-21 10:27:13 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-22 06:15:33 -0400
commitaf2d237bf574f89ae5a1b67f2556a324c8f64ff5 (patch)
treed15e2b3c69f767e5cf847fa0b77a839fe58455c6 /arch/x86/kernel/crash_dump_64.c
parent72d31053f62c4bc464c2783974926969614a8649 (diff)
x86: check for ioremap() failure in copy_oldmem_page()
Add a check for ioremap() failure in copy_oldmem_page(). This patch also includes small coding style fixes. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/crash_dump_64.c')
-rw-r--r--arch/x86/kernel/crash_dump_64.c6
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;