diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-09-21 16:27:13 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-22 12:15:33 +0200 |
commit | af2d237bf574f89ae5a1b67f2556a324c8f64ff5 (patch) | |
tree | d15e2b3c69f767e5cf847fa0b77a839fe58455c6 | |
parent | Linux 2.6.27-rc7 (diff) | |
download | linux-af2d237bf574f89ae5a1b67f2556a324c8f64ff5.tar.xz linux-af2d237bf574f89ae5a1b67f2556a324c8f64ff5.zip |
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>
-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, return 0; vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); + if (!vaddr) + return -ENOMEM; if (userbuf) { - if (copy_to_user(buf, (vaddr + offset), csize)) { + if (copy_to_user(buf, vaddr + offset, csize)) { iounmap(vaddr); return -EFAULT; } } else - memcpy(buf, (vaddr + offset), csize); + memcpy(buf, vaddr + offset, csize); iounmap(vaddr); return csize; |