A cloned bio still needs destructor set (and should clear bi_io_vec as
well), this was broken when Jens rewrote bio_alloc() recently.
This should now be OK with the mempool_alloc failing, and initialises
bi_io_vec = NULL for nr_iovecs = 0.
bio_init(bio);
if (unlikely(!nr_iovecs))
- goto out;
+ goto noiovec;
bvl = bvec_alloc(gfp_mask, nr_iovecs, &idx);
if (bvl) {
bio->bi_flags |= idx << BIO_POOL_OFFSET;
bio->bi_max_vecs = bvec_array[idx].nr_vecs;
+noiovec:
bio->bi_io_vec = bvl;
bio->bi_destructor = bio_destructor;
out: