aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 13c15480d940..6d2d41ae9e32 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -858,8 +858,7 @@ static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone)
858 unsigned int i; 858 unsigned int i;
859 struct bio_vec *bv; 859 struct bio_vec *bv;
860 860
861 for (i = 0; i < clone->bi_vcnt; i++) { 861 bio_for_each_segment_all(bv, clone, i) {
862 bv = bio_iovec_idx(clone, i);
863 BUG_ON(!bv->bv_page); 862 BUG_ON(!bv->bv_page);
864 mempool_free(bv->bv_page, cc->page_pool); 863 mempool_free(bv->bv_page, cc->page_pool);
865 bv->bv_page = NULL; 864 bv->bv_page = NULL;