]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86: check for ioremap() failure in copy_oldmem_page()
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 21 Sep 2008 14:27:13 +0000 (23:27 +0900)
committerIngo Molnar <mingo@elte.hu>
Mon, 22 Sep 2008 10:15:33 +0000 (12:15 +0200)
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>
arch/x86/kernel/crash_dump_64.c

index 15e6c6bc4a46644490cfe565c342b562cddb383d..280d6ef3af0266c498bc1eefc9907ba017c338ff 100644 (file)
@@ -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;