|
@@ -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)) {
|