[ZVC 2/4] highmem.c: Use page after it may have been freed

From: Christoph Lameter
Date: Tue Jun 27 2006 - 13:44:59 EST


ZVC: highmem.c: Use page after it may have been freed

This is not really a problem since the zone of a page does not
change after it has been freed but its cleaner to use the
page as a reference before it has been freed.

Move the dec_zone_page_state before the free.

Signed-off-by: Christoph Lameter <clameter@xxxxxxx>

Index: linux-2.6.17-mm3/mm/highmem.c
===================================================================
--- linux-2.6.17-mm3.orig/mm/highmem.c 2006-06-27 09:40:25.586421810 -0700
+++ linux-2.6.17-mm3/mm/highmem.c 2006-06-27 09:42:19.342074956 -0700
@@ -315,8 +315,8 @@ static void bounce_end_io(struct bio *bi
if (bvec->bv_page == org_vec->bv_page)
continue;

- mempool_free(bvec->bv_page, pool);
dec_zone_page_state(bvec->bv_page, NR_BOUNCE);
+ mempool_free(bvec->bv_page, pool);
}

bio_endio(bio_orig, bio_orig->bi_size, err);
-
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/