X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fbio-integrity.c;h=a16f29e888cd837dd1de4669755c0883bfeb715a;hb=a058a632747dd0f1799b12f4ecd54e43f5b5f10d;hp=49a34e7f7306d49af72b6d84fda277b82d01cc01;hpb=2d4ff66ad7b8811d0c75ccccad346496f67cb43a;p=mv-sheeva.git diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c index 49a34e7f730..a16f29e888c 100644 --- a/fs/bio-integrity.c +++ b/fs/bio-integrity.c @@ -61,7 +61,7 @@ static inline unsigned int vecs_to_idx(unsigned int nr) static inline int use_bip_pool(unsigned int idx) { - if (idx == BIOVEC_NR_POOLS) + if (idx == BIOVEC_MAX_IDX) return 1; return 0; @@ -95,6 +95,7 @@ struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio, /* Use mempool if lower order alloc failed or max vecs were requested */ if (bip == NULL) { + idx = BIOVEC_MAX_IDX; /* so we free the payload properly later */ bip = mempool_alloc(bs->bio_integrity_pool, gfp_mask); if (unlikely(bip == NULL)) {