diff options
| -rw-r--r-- | block/bio-integrity.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 42536674020a..4db620849515 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c | |||
| @@ -43,8 +43,7 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, | |||
| 43 | unsigned inline_vecs; | 43 | unsigned inline_vecs; |
| 44 | 44 | ||
| 45 | if (!bs || !mempool_initialized(&bs->bio_integrity_pool)) { | 45 | if (!bs || !mempool_initialized(&bs->bio_integrity_pool)) { |
| 46 | bip = kmalloc(sizeof(struct bio_integrity_payload) + | 46 | bip = kmalloc(struct_size(bip, bip_inline_vecs, nr_vecs), gfp_mask); |
| 47 | sizeof(struct bio_vec) * nr_vecs, gfp_mask); | ||
| 48 | inline_vecs = nr_vecs; | 47 | inline_vecs = nr_vecs; |
| 49 | } else { | 48 | } else { |
| 50 | bip = mempool_alloc(&bs->bio_integrity_pool, gfp_mask); | 49 | bip = mempool_alloc(&bs->bio_integrity_pool, gfp_mask); |
