patch-2.4.23 linux-2.4.23/arch/m68k/mm/kmap.c

Next file: linux-2.4.23/arch/m68k/mm/memory.c
Previous file: linux-2.4.23/arch/m68k/math-emu/fp_log.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/arch/m68k/mm/kmap.c linux-2.4.23/arch/m68k/mm/kmap.c
@@ -71,7 +71,7 @@
 		addr = tmp->size + (unsigned long)tmp->addr;
 	}
 	area->addr = (void *)addr;
-	area->size = size + IO_SIZE;
+	area->size = size + IO_SIZE;	/* leave a gap between */
 	area->next = *p;
 	*p = area;
 	return area;
@@ -87,7 +87,10 @@
 	for (p = &iolist ; (tmp = *p) ; p = &tmp->next) {
 		if (tmp->addr == addr) {
 			*p = tmp->next;
-			__iounmap(tmp->addr, tmp->size);
+			if ( tmp->size > IO_SIZE )
+				__iounmap(tmp->addr, tmp->size - IO_SIZE);
+			else
+				printk("free_io_area: Invalid I/O area size %lu\n", tmp->size);
 			kfree(tmp);
 			return;
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)