Commit e80e317b authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] fix iounmap for non page aligned addresses

This fixes a problem introduced by the pageattr ioremap/unmap patches.
iounmap lost the ability to free non page aligned addresses, which
are e.g. used by the bootflag code.  This patch fixes this.

Also fix a potential off by one bug.
parent a4e2c5d1
...@@ -213,9 +213,9 @@ void *ioremap_nocache (unsigned long phys_addr, unsigned long size) ...@@ -213,9 +213,9 @@ void *ioremap_nocache (unsigned long phys_addr, unsigned long size)
void iounmap(void *addr) void iounmap(void *addr)
{ {
struct vm_struct *p; struct vm_struct *p;
if (addr < high_memory) if (addr <= high_memory)
return; return;
p = remove_kernel_area(addr); p = remove_kernel_area(PAGE_MASK & (unsigned long) addr);
if (!p) { if (!p) {
printk("__iounmap: bad address %p\n", addr); printk("__iounmap: bad address %p\n", addr);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment