diff options
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -302,9 +302,10 @@ void bio_init(struct bio *bio) | |||
302 | struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) | 302 | struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) |
303 | { | 303 | { |
304 | struct bio *bio = NULL; | 304 | struct bio *bio = NULL; |
305 | void *uninitialized_var(p); | ||
305 | 306 | ||
306 | if (bs) { | 307 | if (bs) { |
307 | void *p = mempool_alloc(bs->bio_pool, gfp_mask); | 308 | p = mempool_alloc(bs->bio_pool, gfp_mask); |
308 | 309 | ||
309 | if (p) | 310 | if (p) |
310 | bio = p + bs->front_pad; | 311 | bio = p + bs->front_pad; |
@@ -329,7 +330,7 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) | |||
329 | } | 330 | } |
330 | if (unlikely(!bvl)) { | 331 | if (unlikely(!bvl)) { |
331 | if (bs) | 332 | if (bs) |
332 | mempool_free(bio, bs->bio_pool); | 333 | mempool_free(p, bs->bio_pool); |
333 | else | 334 | else |
334 | kfree(bio); | 335 | kfree(bio); |
335 | bio = NULL; | 336 | bio = NULL; |
@@ -462,10 +463,12 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask) | |||
462 | if (bio_integrity(bio)) { | 463 | if (bio_integrity(bio)) { |
463 | int ret; | 464 | int ret; |
464 | 465 | ||
465 | ret = bio_integrity_clone(b, bio, fs_bio_set); | 466 | ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set); |
466 | 467 | ||
467 | if (ret < 0) | 468 | if (ret < 0) { |
469 | bio_put(b); | ||
468 | return NULL; | 470 | return NULL; |
471 | } | ||
469 | } | 472 | } |
470 | 473 | ||
471 | return b; | 474 | return b; |