Skip to content
Snippets Groups Projects
Commit af2d237b authored by Akinobu Mita's avatar Akinobu Mita Committed by Ingo Molnar
Browse files

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: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 72d31053
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment