Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 992c5dda authored by Jens Axboe's avatar Jens Axboe
Browse files

bio: make freeing of ->bi_io_vec conditional in bio_free()



The empty barrier patches do not carry data, so they have no
iovec attached.

Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 2b94de55
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -109,11 +109,14 @@ static inline struct bio_vec *bvec_alloc_bs(gfp_t gfp_mask, int nr, unsigned lon

void bio_free(struct bio *bio, struct bio_set *bio_set)
{
	if (bio->bi_io_vec) {
		const int pool_idx = BIO_POOL_IDX(bio);

		BIO_BUG_ON(pool_idx >= BIOVEC_NR_POOLS);

		mempool_free(bio->bi_io_vec, bio_set->bvec_pools[pool_idx]);
	}

	mempool_free(bio, bio_set->bio_pool);
}