diff options
author | Christoph Hellwig <hch@lst.de> | 2021-02-02 18:19:24 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-02-08 08:33:16 -0700 |
commit | 0f2e6ab851ae146c468bc5151c302c6e2473f70a (patch) | |
tree | 740ef403c488f74f65f71b838df33970c4244433 /block | |
parent | de76fd893074ab2cea132c28ac9efd9d0434215e (diff) | |
download | linux-stable-0f2e6ab851ae146c468bc5151c302c6e2473f70a.tar.gz linux-stable-0f2e6ab851ae146c468bc5151c302c6e2473f70a.tar.bz2 linux-stable-0f2e6ab851ae146c468bc5151c302c6e2473f70a.zip |
block: turn the nr_iovecs argument to bio_alloc* into an unsigned short
The bi_max_vecs and bi_vcnt fields are defined as unsigned short, so
don't allow passing larger values in.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/bio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/bio.c b/block/bio.c index ae241252ea14..3d28d4723f6f 100644 --- a/block/bio.c +++ b/block/bio.c @@ -407,7 +407,7 @@ static void punt_bios_to_rescuer(struct bio_set *bs) * * Returns: Pointer to new bio on success, NULL on failure. */ -struct bio *bio_alloc_bioset(gfp_t gfp_mask, unsigned int nr_iovecs, +struct bio *bio_alloc_bioset(gfp_t gfp_mask, unsigned short nr_iovecs, struct bio_set *bs) { gfp_t saved_gfp = gfp_mask; @@ -493,7 +493,7 @@ EXPORT_SYMBOL(bio_alloc_bioset); * * Returns: Pointer to new bio on success, NULL on failure. */ -struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned int nr_iovecs) +struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned short nr_iovecs) { struct bio *bio; |