From: Mark Haverkamp Last September a fix was checked in for a memory leak problem in bounce_end_io causing the entire bio to be checked. This ended up causing some dm cloned bios that had bounce buffers to free NULL pages because their bi_idx can be non-zero. This patch skips NULL pages in the bio's bio_vec. I'm not sure if this is the most optimal fix but I think that it is safe since bvec_alloc memsets the bio_vec to zero. Signed-off-by Mark Haverkamp Signed-off-by: Andrew Morton --- 25-akpm/mm/highmem.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN mm/highmem.c~fix-panic-in-26-with-bounced-bio-and-dm mm/highmem.c --- 25/mm/highmem.c~fix-panic-in-26-with-bounced-bio-and-dm Fri Feb 25 16:14:43 2005 +++ 25-akpm/mm/highmem.c Fri Feb 25 16:14:43 2005 @@ -319,7 +319,7 @@ static void bounce_end_io(struct bio *bi */ __bio_for_each_segment(bvec, bio, i, 0) { org_vec = bio_orig->bi_io_vec + i; - if (bvec->bv_page == org_vec->bv_page) + if (!bvec->bv_page || bvec->bv_page == org_vec->bv_page) continue; mempool_free(bvec->bv_page, pool); _