[PATCH] Fix kunmap() argument in sg_miter_stop

From: Arjan van de Ven
Date: Sat Nov 15 2008 - 14:23:58 EST


kunmap() takes as argument the struct page that orginally got kmap()'d,
however the sg_miter_stop() function passed it the kernel virtual address
instead, resulting in "kernel BUG at arch/x86/mm/highmem_32.c:115!"

This is moderately popular on kerneloops.org, mostly in interaction with the MMC layer.

Reported-by: kerneloops.org
CC: htejun@xxxxxxxxx
CC: stable@xxxxxxxxxx

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
---
lib/scatterlist.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 8d2688f..b7b449d 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -395,7 +395,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
WARN_ON(!irqs_disabled());
kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ);
} else
- kunmap(miter->addr);
+ kunmap(miter->page);

miter->page = NULL;
miter->addr = NULL;
--
1.6.0.3


--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/