diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-17 16:21:20 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-17 16:21:20 +0100 |
commit | 47239561e39bceefecc3cd67f71fcf86a198a8ff (patch) | |
tree | 9823d0973494ea8acabb744bc3aba42b610fb434 /fs/bio.c | |
parent | ed681a91ab805341675d166a9592551093c0a2d9 (diff) | |
parent | 5bee17f18b595937e6beafeee5197868a3f74a06 (diff) | |
download | op-kernel-dev-47239561e39bceefecc3cd67f71fcf86a198a8ff.zip op-kernel-dev-47239561e39bceefecc3cd67f71fcf86a198a8ff.tar.gz |
Merge branch 'linus' into core/printk
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) struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) { struct bio *bio = NULL; + void *uninitialized_var(p); if (bs) { - void *p = mempool_alloc(bs->bio_pool, gfp_mask); + p = mempool_alloc(bs->bio_pool, gfp_mask); if (p) 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) } if (unlikely(!bvl)) { if (bs) - mempool_free(bio, bs->bio_pool); + mempool_free(p, bs->bio_pool); else kfree(bio); bio = NULL; @@ -462,10 +463,12 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask) if (bio_integrity(bio)) { int ret; - ret = bio_integrity_clone(b, bio, fs_bio_set); + ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set); - if (ret < 0) + if (ret < 0) { + bio_put(b); return NULL; + } } return b; |